@ai-setting/roy-agent-cli 1.5.115 → 1.5.116

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.
@@ -7427,7 +7427,7 @@ var require_dist = __commonJS((exports) => {
7427
7427
  var require_package = __commonJS((exports, module) => {
7428
7428
  module.exports = {
7429
7429
  name: "@ai-setting/roy-agent-cli",
7430
- version: "1.5.115",
7430
+ version: "1.5.116",
7431
7431
  type: "module",
7432
7432
  description: "CLI for roy-agent - Non-interactive command execution",
7433
7433
  main: "./dist/index.js",
@@ -19868,42 +19868,23 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
19868
19868
  if (args.session) {
19869
19869
  const sessionId = args.session;
19870
19870
  output.log(chalk70.blue(`\uD83D\uDD04 Resuming workflow from session: ${sessionId}`));
19871
- const sessionComponent = workflowComponent.sessionComponent;
19872
- if (!sessionComponent) {
19873
- output.error("SessionComponent not available");
19874
- process.exit(1);
19875
- }
19876
- const session = await sessionComponent.get(sessionId);
19877
- if (!session) {
19878
- output.error(`Session not found: ${sessionId}`);
19879
- process.exit(1);
19880
- }
19881
- const metadata = session.metadata;
19882
- if (metadata?.type !== "workflow") {
19883
- output.error(`Session is not a workflow session: ${sessionId}`);
19884
- process.exit(1);
19885
- }
19886
- const workflowName = metadata.workflowName;
19887
- if (!workflowName) {
19888
- output.error("Workflow name not found in session metadata");
19889
- process.exit(1);
19890
- }
19891
- const workflow = service.getWorkflowByName(workflowName);
19892
- if (!workflow) {
19893
- output.error(`Workflow not found: ${workflowName}`);
19894
- process.exit(1);
19871
+ try {
19872
+ const resumeInput = typeof input === "string" ? { userQuery: input } : input;
19873
+ const result = await service.resumeSession(sessionId, {
19874
+ ...runOptions,
19875
+ ...resumeInput !== undefined ? { input: resumeInput } : {}
19876
+ });
19877
+ output.log(renderRunResult({
19878
+ runId: sessionId,
19879
+ status: result.status,
19880
+ output: result.output,
19881
+ error: result.error,
19882
+ durationMs: result.durationMs
19883
+ }));
19884
+ } catch (err) {
19885
+ const msg = err instanceof Error ? err.message : String(err);
19886
+ output.error(`Failed to resume session ${sessionId}: ${msg}`);
19895
19887
  }
19896
- const engine = service.engineFactory(workflow);
19897
- const result = await engine.run(sessionId, {
19898
- input: input || undefined
19899
- });
19900
- output.log(renderRunResult({
19901
- runId: sessionId,
19902
- status: result.status,
19903
- output: result.output,
19904
- error: result.error,
19905
- durationMs: result.durationMs
19906
- }));
19907
19888
  if (workflowSpan) {
19908
19889
  workflowSpan.end();
19909
19890
  }
package/dist/index.js CHANGED
@@ -7426,7 +7426,7 @@ var require_dist = __commonJS((exports) => {
7426
7426
  var require_package = __commonJS((exports, module) => {
7427
7427
  module.exports = {
7428
7428
  name: "@ai-setting/roy-agent-cli",
7429
- version: "1.5.115",
7429
+ version: "1.5.116",
7430
7430
  type: "module",
7431
7431
  description: "CLI for roy-agent - Non-interactive command execution",
7432
7432
  main: "./dist/index.js",
@@ -19867,42 +19867,23 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
19867
19867
  if (args.session) {
19868
19868
  const sessionId = args.session;
19869
19869
  output.log(chalk70.blue(`\uD83D\uDD04 Resuming workflow from session: ${sessionId}`));
19870
- const sessionComponent = workflowComponent.sessionComponent;
19871
- if (!sessionComponent) {
19872
- output.error("SessionComponent not available");
19873
- process.exit(1);
19874
- }
19875
- const session = await sessionComponent.get(sessionId);
19876
- if (!session) {
19877
- output.error(`Session not found: ${sessionId}`);
19878
- process.exit(1);
19879
- }
19880
- const metadata = session.metadata;
19881
- if (metadata?.type !== "workflow") {
19882
- output.error(`Session is not a workflow session: ${sessionId}`);
19883
- process.exit(1);
19884
- }
19885
- const workflowName = metadata.workflowName;
19886
- if (!workflowName) {
19887
- output.error("Workflow name not found in session metadata");
19888
- process.exit(1);
19889
- }
19890
- const workflow = service.getWorkflowByName(workflowName);
19891
- if (!workflow) {
19892
- output.error(`Workflow not found: ${workflowName}`);
19893
- process.exit(1);
19870
+ try {
19871
+ const resumeInput = typeof input === "string" ? { userQuery: input } : input;
19872
+ const result = await service.resumeSession(sessionId, {
19873
+ ...runOptions,
19874
+ ...resumeInput !== undefined ? { input: resumeInput } : {}
19875
+ });
19876
+ output.log(renderRunResult({
19877
+ runId: sessionId,
19878
+ status: result.status,
19879
+ output: result.output,
19880
+ error: result.error,
19881
+ durationMs: result.durationMs
19882
+ }));
19883
+ } catch (err) {
19884
+ const msg = err instanceof Error ? err.message : String(err);
19885
+ output.error(`Failed to resume session ${sessionId}: ${msg}`);
19894
19886
  }
19895
- const engine = service.engineFactory(workflow);
19896
- const result = await engine.run(sessionId, {
19897
- input: input || undefined
19898
- });
19899
- output.log(renderRunResult({
19900
- runId: sessionId,
19901
- status: result.status,
19902
- output: result.output,
19903
- error: result.error,
19904
- durationMs: result.durationMs
19905
- }));
19906
19887
  if (workflowSpan) {
19907
19888
  workflowSpan.end();
19908
19889
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-cli",
3
- "version": "1.5.115",
3
+ "version": "1.5.116",
4
4
  "type": "module",
5
5
  "description": "CLI for roy-agent - Non-interactive command execution",
6
6
  "main": "./dist/index.js",