buckyos 0.7.162 → 0.7.164

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.
@@ -1726,6 +1726,35 @@ class TaskManagerClient {
1726
1726
  }
1727
1727
  }
1728
1728
  const WORKFLOW_SERVICE_NAME = "workflow";
1729
+ const WorkflowErrorCode = {
1730
+ ToolsMissing: "tools_missing",
1731
+ Timeout: "timeout",
1732
+ Cancelled: "cancelled",
1733
+ Interrupted: "interrupted",
1734
+ PermissionDenied: "permission_denied",
1735
+ ResourceLimit: "resource_limit",
1736
+ EnvironmentChanged: "environment_changed",
1737
+ InvalidParams: "invalid_params",
1738
+ InvalidResult: "invalid_result",
1739
+ InputUnavailable: "input_unavailable",
1740
+ ToolFailed: "tool_failed",
1741
+ FunctionNotFound: "function_not_found",
1742
+ QueueFull: "queue_full",
1743
+ Internal: "internal",
1744
+ SystemDefinitionReadOnly: "system_definition_read_only",
1745
+ UnresolvedFunction: "unresolved_function",
1746
+ RunTerminal: "run_terminal",
1747
+ InvalidInput: "invalid_input",
1748
+ NotAuthorized: "not_authorized"
1749
+ };
1750
+ class WorkflowRequestError extends RPCError {
1751
+ constructor(code, message, detail) {
1752
+ super(message);
1753
+ this.name = "WorkflowRequestError";
1754
+ this.code = code;
1755
+ this.detail = detail;
1756
+ }
1757
+ }
1729
1758
  var WorkflowStepType = /* @__PURE__ */ ((WorkflowStepType2) => {
1730
1759
  WorkflowStepType2["Autonomous"] = "autonomous";
1731
1760
  WorkflowStepType2["HumanConfirm"] = "human_confirm";
@@ -1835,14 +1864,17 @@ class WorkflowClient {
1835
1864
  if (parsed.ok === true) {
1836
1865
  return parsed;
1837
1866
  }
1838
- const message = typeof parsed.message === "string" ? parsed.message : typeof parsed.error === "string" ? parsed.error : "workflow request failed";
1839
- throw new RPCError(message);
1867
+ const code = typeof parsed.error === "string" ? parsed.error : "workflow_error";
1868
+ const message = typeof parsed.message === "string" ? parsed.message : code;
1869
+ throw new WorkflowRequestError(code, message, parsed.detail);
1840
1870
  }
1841
1871
  async submitDefinition(request) {
1842
1872
  const result = await this.callOk("submit_definition", request);
1843
1873
  return {
1844
1874
  workflow_id: requiredField(result, "workflow_id"),
1845
1875
  version: requiredField(result, "version"),
1876
+ revision: requiredField(result, "revision"),
1877
+ source: requiredField(result, "source"),
1846
1878
  analysis: requiredField(result, "analysis"),
1847
1879
  definition: requiredField(result, "definition")
1848
1880
  };
@@ -1863,21 +1895,46 @@ class WorkflowClient {
1863
1895
  const result = await this.callOk("dry_run", { definition });
1864
1896
  return {
1865
1897
  analysis: requiredField(result, "analysis"),
1866
- graph: requiredField(result, "graph")
1898
+ graph: requiredField(result, "graph"),
1899
+ revision: requiredField(result, "revision"),
1900
+ resolved_functions: requiredField(result, "resolved_functions")
1901
+ };
1902
+ }
1903
+ async listFunctions(prefix) {
1904
+ const result = await this.callOk("list_functions", prefix ? { prefix } : {});
1905
+ return requiredField(result, "functions");
1906
+ }
1907
+ async getFunction(ref) {
1908
+ const result = await this.callOk("get_function", ref);
1909
+ return requiredField(result, "function");
1910
+ }
1911
+ async getCapabilities() {
1912
+ const result = await this.callOk("get_capabilities", {});
1913
+ return {
1914
+ execution_epoch: requiredField(result, "execution_epoch"),
1915
+ environment: requiredField(result, "environment"),
1916
+ functions: requiredField(result, "functions")
1867
1917
  };
1868
1918
  }
1869
1919
  async createRun(request) {
1870
1920
  return await this.callOk("create_run", request);
1871
1921
  }
1872
- async startRun(runId) {
1873
- return await this.callOk("start_run", { run_id: runId });
1922
+ async startRun(runId, waitMs) {
1923
+ const request = waitMs == null ? { run_id: runId } : { run_id: runId, wait_ms: waitMs };
1924
+ return await this.callOk("start_run", request);
1874
1925
  }
1875
1926
  async tickRun(runId) {
1876
1927
  return await this.callOk("tick_run", { run_id: runId });
1877
1928
  }
1929
+ async cancelRun(request) {
1930
+ return await this.callOk("cancel_run", request);
1931
+ }
1878
1932
  async getRunGraph(runId) {
1879
1933
  return await this.callOk("get_run_graph", { run_id: runId });
1880
1934
  }
1935
+ async getRunOutput(runId) {
1936
+ return await this.callOk("get_run_output", { run_id: runId });
1937
+ }
1881
1938
  async listRuns(request = {}) {
1882
1939
  const result = await this.callOk("list_runs", request);
1883
1940
  return requiredField(result, "runs");
@@ -30602,7 +30659,7 @@ export {
30602
30659
  TASK_MANAGER_SERVICE_PORT as ay,
30603
30660
  TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1 as az,
30604
30661
  bns_client as b,
30605
- videoGenerationRequirement as b$,
30662
+ validateVideoGeneration as b$,
30606
30663
  TASK_ERR_CONTROL_NOT_AVAILABLE as b0,
30607
30664
  TASK_ERR_CONTROL_ALREADY_PENDING as b1,
30608
30665
  TASK_ERR_ALREADY_COMPLETED as b2,
@@ -30613,33 +30670,33 @@ export {
30613
30670
  TASK_MGR_ERROR_CODES as b7,
30614
30671
  taskMgrTaskEventPath as b8,
30615
30672
  taskMgrTreeEventPath as b9,
30616
- WorkflowScheduledTaskFireStatus as bA,
30617
- WorkflowClient as bB,
30618
- AICC_SERVICE_UNIQUE_ID as bC,
30619
- AICC_SERVICE_SERVICE_NAME as bD,
30620
- AICC_SERVICE_SERVICE_PORT as bE,
30621
- AICC_AI_METHODS as bF,
30622
- AICC_CORE_METHODS as bG,
30623
- AICC_MANAGEMENT_METHODS as bH,
30624
- AICC_QUOTA_METHODS as bI,
30625
- AICC_METHODS as bJ,
30626
- AICC_FEATURES as bK,
30627
- AICC_EXECUTION_MODES as bL,
30628
- AICC_POLICY_REFUSAL_CODES as bM,
30629
- aiccRefusalOf as bN,
30630
- isAiccAiMethod as bO,
30631
- aiccTextMessage as bP,
30632
- aiccMessageTextContent as bQ,
30633
- aiccMessageFirstText as bR,
30634
- validateAiccMessage as bS,
30635
- AiccClient as bT,
30636
- decisionRequirements as bU,
30637
- validateDecisionRequest as bV,
30638
- validateDecisionAnswers as bW,
30639
- parseVideoPrompt as bX,
30640
- validateVideoOutput as bY,
30641
- validateVideoGeneration as bZ,
30642
- validateVideoEdit as b_,
30673
+ WorkflowScheduledTaskStatus as bA,
30674
+ WorkflowScheduledTaskMisfirePolicy as bB,
30675
+ WorkflowScheduledTaskFireStatus as bC,
30676
+ WorkflowClient as bD,
30677
+ AICC_SERVICE_UNIQUE_ID as bE,
30678
+ AICC_SERVICE_SERVICE_NAME as bF,
30679
+ AICC_SERVICE_SERVICE_PORT as bG,
30680
+ AICC_AI_METHODS as bH,
30681
+ AICC_CORE_METHODS as bI,
30682
+ AICC_MANAGEMENT_METHODS as bJ,
30683
+ AICC_QUOTA_METHODS as bK,
30684
+ AICC_METHODS as bL,
30685
+ AICC_FEATURES as bM,
30686
+ AICC_EXECUTION_MODES as bN,
30687
+ AICC_POLICY_REFUSAL_CODES as bO,
30688
+ aiccRefusalOf as bP,
30689
+ isAiccAiMethod as bQ,
30690
+ aiccTextMessage as bR,
30691
+ aiccMessageTextContent as bS,
30692
+ aiccMessageFirstText as bT,
30693
+ validateAiccMessage as bU,
30694
+ AiccClient as bV,
30695
+ decisionRequirements as bW,
30696
+ validateDecisionRequest as bX,
30697
+ validateDecisionAnswers as bY,
30698
+ parseVideoPrompt as bZ,
30699
+ validateVideoOutput as b_,
30643
30700
  taskMgrErrorCode as ba,
30644
30701
  TaskExecutorKind as bb,
30645
30702
  TaskPhase as bc,
@@ -30656,46 +30713,48 @@ export {
30656
30713
  TaskEventType as bn,
30657
30714
  TaskManagerClient as bo,
30658
30715
  WORKFLOW_SERVICE_NAME as bp,
30659
- WorkflowStepType as bq,
30660
- WorkflowOutputMode as br,
30661
- WorkflowJoinMode as bs,
30662
- WorkflowRetryFallback as bt,
30663
- WorkflowDefinitionStatus as bu,
30664
- WorkflowRunStatus as bv,
30665
- WorkflowNodeRunState as bw,
30666
- WorkflowHumanActionKind as bx,
30667
- WorkflowScheduledTaskStatus as by,
30668
- WorkflowScheduledTaskMisfirePolicy as bz,
30716
+ WorkflowErrorCode as bq,
30717
+ WorkflowRequestError as br,
30718
+ WorkflowStepType as bs,
30719
+ WorkflowOutputMode as bt,
30720
+ WorkflowJoinMode as bu,
30721
+ WorkflowRetryFallback as bv,
30722
+ WorkflowDefinitionStatus as bw,
30723
+ WorkflowRunStatus as bx,
30724
+ WorkflowNodeRunState as by,
30725
+ WorkflowHumanActionKind as bz,
30669
30726
  createSDKModule as c,
30670
- KEventReader as c0,
30671
- KEventClient as c1,
30672
- appIdFromDid as c2,
30673
- parseAppId as c3,
30674
- appDidFromId as c4,
30675
- createAppInstanceId as c5,
30676
- parseAppInstanceId as c6,
30677
- BNS_EVM_DEFAULT_GAS_LIMIT as c7,
30678
- BNS_EVM_DEFAULT_MAX_FEE_PER_GAS as c8,
30679
- BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS as c9,
30680
- BNS_MAX_INLINE_DOCUMENT_BYTES as ca,
30681
- BNS_DNS_TXT_DEFAULT_TTL as cb,
30682
- BNS_DNS_TXT_DOC_TYPE as cc,
30683
- BNS_PUBLISH_DOCUMENT_ABI as cd,
30684
- BnsEvmTxError as ce,
30685
- BnsEvmTxBuilder as cf,
30686
- decodeBnsPublishDocumentCalldata as cg,
30687
- BnsTxExecutorError as ch,
30688
- walletUserHasSnAccount as ci,
30689
- BnsTxExecutor as cj,
30690
- ExecutorClient as ck,
30691
- ExecutorStreamError as cl,
30692
- encodeExecutorControl as cm,
30693
- ExecutorCommandStream as cn,
30694
- AIWORKSPACE_SERVICE_NAME as co,
30695
- AiwsFailure as cp,
30696
- aiwsReferenceUrl as cq,
30697
- parseAiwsReferenceUrl as cr,
30698
- AiWorkspaceClient as cs,
30727
+ validateVideoEdit as c0,
30728
+ videoGenerationRequirement as c1,
30729
+ KEventReader as c2,
30730
+ KEventClient as c3,
30731
+ appIdFromDid as c4,
30732
+ parseAppId as c5,
30733
+ appDidFromId as c6,
30734
+ createAppInstanceId as c7,
30735
+ parseAppInstanceId as c8,
30736
+ BNS_EVM_DEFAULT_GAS_LIMIT as c9,
30737
+ BNS_EVM_DEFAULT_MAX_FEE_PER_GAS as ca,
30738
+ BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS as cb,
30739
+ BNS_MAX_INLINE_DOCUMENT_BYTES as cc,
30740
+ BNS_DNS_TXT_DEFAULT_TTL as cd,
30741
+ BNS_DNS_TXT_DOC_TYPE as ce,
30742
+ BNS_PUBLISH_DOCUMENT_ABI as cf,
30743
+ BnsEvmTxError as cg,
30744
+ BnsEvmTxBuilder as ch,
30745
+ decodeBnsPublishDocumentCalldata as ci,
30746
+ BnsTxExecutorError as cj,
30747
+ walletUserHasSnAccount as ck,
30748
+ BnsTxExecutor as cl,
30749
+ ExecutorClient as cm,
30750
+ ExecutorStreamError as cn,
30751
+ encodeExecutorControl as co,
30752
+ ExecutorCommandStream as cp,
30753
+ AIWORKSPACE_SERVICE_NAME as cq,
30754
+ AiwsFailure as cr,
30755
+ aiwsReferenceUrl as cs,
30756
+ parseAiwsReferenceUrl as ct,
30757
+ AiWorkspaceClient as cu,
30699
30758
  bucket_client as d,
30700
30759
  BS_SERVICE_TASK_MANAGER as e,
30701
30760
  getActiveRuntimeType as f,
@@ -30720,4 +30779,4 @@ export {
30720
30779
  NOTIFY_SESSION_PREFIX as y,
30721
30780
  NOTIFY_CHOICE_CONTROL_ID as z
30722
30781
  };
30723
- //# sourceMappingURL=executor_client-0856c3fc.mjs.map
30782
+ //# sourceMappingURL=executor_client-86315a2f.mjs.map