@locusai/cli 0.11.5 → 0.11.7

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.
@@ -14731,12 +14731,519 @@ var init_models = __esm(() => {
14731
14731
  init_workspace();
14732
14732
  });
14733
14733
 
14734
+ // ../shared/src/protocol/envelope.ts
14735
+ var PROTOCOL_VERSION = 1, ProtocolVersionSchema, ProtocolEnvelopeSchema;
14736
+ var init_envelope = __esm(() => {
14737
+ init_zod();
14738
+ ProtocolVersionSchema = exports_external.literal(PROTOCOL_VERSION);
14739
+ ProtocolEnvelopeSchema = exports_external.object({
14740
+ protocol: ProtocolVersionSchema,
14741
+ type: exports_external.string()
14742
+ });
14743
+ });
14744
+
14745
+ // ../shared/src/protocol/errors.ts
14746
+ var ProtocolErrorCode, ProtocolErrorCodeSchema, ProtocolErrorSchema;
14747
+ var init_errors3 = __esm(() => {
14748
+ init_zod();
14749
+ ProtocolErrorCode = {
14750
+ CLI_NOT_FOUND: "CLI_NOT_FOUND",
14751
+ AUTH_EXPIRED: "AUTH_EXPIRED",
14752
+ NETWORK_TIMEOUT: "NETWORK_TIMEOUT",
14753
+ CONTEXT_LIMIT: "CONTEXT_LIMIT",
14754
+ MALFORMED_EVENT: "MALFORMED_EVENT",
14755
+ PROCESS_CRASHED: "PROCESS_CRASHED",
14756
+ SESSION_NOT_FOUND: "SESSION_NOT_FOUND",
14757
+ UNKNOWN: "UNKNOWN"
14758
+ };
14759
+ ProtocolErrorCodeSchema = exports_external.enum(ProtocolErrorCode);
14760
+ ProtocolErrorSchema = exports_external.object({
14761
+ code: ProtocolErrorCodeSchema,
14762
+ message: exports_external.string(),
14763
+ details: exports_external.unknown().optional(),
14764
+ recoverable: exports_external.boolean()
14765
+ });
14766
+ });
14767
+
14768
+ // ../shared/src/protocol/cli-stream.ts
14769
+ var CliStreamEventType, CliStreamEventTypeSchema, CliStreamBaseSchema, CliStartEventSchema, CliTextDeltaEventSchema, CliThinkingEventSchema, CliToolStartedEventSchema, CliToolCompletedEventSchema, CliStatusEventSchema, CliErrorEventSchema, CliDoneEventSchema, CliStreamEventSchema;
14770
+ var init_cli_stream = __esm(() => {
14771
+ init_zod();
14772
+ init_envelope();
14773
+ init_errors3();
14774
+ CliStreamEventType = {
14775
+ START: "start",
14776
+ TEXT_DELTA: "text_delta",
14777
+ THINKING: "thinking",
14778
+ TOOL_STARTED: "tool_started",
14779
+ TOOL_COMPLETED: "tool_completed",
14780
+ STATUS: "status",
14781
+ ERROR: "error",
14782
+ DONE: "done"
14783
+ };
14784
+ CliStreamEventTypeSchema = exports_external.enum(CliStreamEventType);
14785
+ CliStreamBaseSchema = exports_external.object({
14786
+ protocol: ProtocolVersionSchema,
14787
+ sessionId: exports_external.string(),
14788
+ timestamp: exports_external.number()
14789
+ });
14790
+ CliStartEventSchema = CliStreamBaseSchema.extend({
14791
+ type: exports_external.literal(CliStreamEventType.START),
14792
+ payload: exports_external.object({
14793
+ command: exports_external.string(),
14794
+ model: exports_external.string().optional(),
14795
+ provider: exports_external.string().optional(),
14796
+ cwd: exports_external.string().optional()
14797
+ })
14798
+ });
14799
+ CliTextDeltaEventSchema = CliStreamBaseSchema.extend({
14800
+ type: exports_external.literal(CliStreamEventType.TEXT_DELTA),
14801
+ payload: exports_external.object({
14802
+ content: exports_external.string()
14803
+ })
14804
+ });
14805
+ CliThinkingEventSchema = CliStreamBaseSchema.extend({
14806
+ type: exports_external.literal(CliStreamEventType.THINKING),
14807
+ payload: exports_external.object({
14808
+ content: exports_external.string().optional()
14809
+ })
14810
+ });
14811
+ CliToolStartedEventSchema = CliStreamBaseSchema.extend({
14812
+ type: exports_external.literal(CliStreamEventType.TOOL_STARTED),
14813
+ payload: exports_external.object({
14814
+ tool: exports_external.string(),
14815
+ toolId: exports_external.string().optional(),
14816
+ parameters: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
14817
+ })
14818
+ });
14819
+ CliToolCompletedEventSchema = CliStreamBaseSchema.extend({
14820
+ type: exports_external.literal(CliStreamEventType.TOOL_COMPLETED),
14821
+ payload: exports_external.object({
14822
+ tool: exports_external.string(),
14823
+ toolId: exports_external.string().optional(),
14824
+ success: exports_external.boolean(),
14825
+ duration: exports_external.number().optional(),
14826
+ error: exports_external.string().optional()
14827
+ })
14828
+ });
14829
+ CliStatusEventSchema = CliStreamBaseSchema.extend({
14830
+ type: exports_external.literal(CliStreamEventType.STATUS),
14831
+ payload: exports_external.object({
14832
+ status: exports_external.string(),
14833
+ message: exports_external.string().optional()
14834
+ })
14835
+ });
14836
+ CliErrorEventSchema = CliStreamBaseSchema.extend({
14837
+ type: exports_external.literal(CliStreamEventType.ERROR),
14838
+ payload: exports_external.object({
14839
+ error: ProtocolErrorSchema
14840
+ })
14841
+ });
14842
+ CliDoneEventSchema = CliStreamBaseSchema.extend({
14843
+ type: exports_external.literal(CliStreamEventType.DONE),
14844
+ payload: exports_external.object({
14845
+ exitCode: exports_external.number().int(),
14846
+ duration: exports_external.number(),
14847
+ toolsUsed: exports_external.array(exports_external.string()).optional(),
14848
+ tokensUsed: exports_external.number().optional(),
14849
+ success: exports_external.boolean()
14850
+ })
14851
+ });
14852
+ CliStreamEventSchema = exports_external.discriminatedUnion("type", [
14853
+ CliStartEventSchema,
14854
+ CliTextDeltaEventSchema,
14855
+ CliThinkingEventSchema,
14856
+ CliToolStartedEventSchema,
14857
+ CliToolCompletedEventSchema,
14858
+ CliStatusEventSchema,
14859
+ CliErrorEventSchema,
14860
+ CliDoneEventSchema
14861
+ ]);
14862
+ });
14863
+
14864
+ // ../shared/src/protocol/context.ts
14865
+ var ActiveFileContextSchema, SelectionContextSchema, WorkspaceContextSchema, ContextPayloadSchema;
14866
+ var init_context = __esm(() => {
14867
+ init_zod();
14868
+ ActiveFileContextSchema = exports_external.object({
14869
+ filePath: exports_external.string(),
14870
+ languageId: exports_external.string().optional()
14871
+ });
14872
+ SelectionContextSchema = exports_external.object({
14873
+ filePath: exports_external.string(),
14874
+ languageId: exports_external.string().optional(),
14875
+ startLine: exports_external.number().int().min(0),
14876
+ startColumn: exports_external.number().int().min(0),
14877
+ endLine: exports_external.number().int().min(0),
14878
+ endColumn: exports_external.number().int().min(0),
14879
+ text: exports_external.string()
14880
+ });
14881
+ WorkspaceContextSchema = exports_external.object({
14882
+ rootPath: exports_external.string(),
14883
+ name: exports_external.string().optional()
14884
+ });
14885
+ ContextPayloadSchema = exports_external.object({
14886
+ workspace: WorkspaceContextSchema.optional(),
14887
+ activeFile: ActiveFileContextSchema.optional(),
14888
+ selection: SelectionContextSchema.optional()
14889
+ });
14890
+ });
14891
+
14892
+ // ../shared/src/protocol/session.ts
14893
+ var SessionStatus, SessionStatusSchema, SessionTransitionEvent, SessionTransitionEventSchema, SESSION_TRANSITIONS, TERMINAL_STATUSES, SessionMetadataSchema, SessionSummarySchema;
14894
+ var init_session = __esm(() => {
14895
+ init_zod();
14896
+ SessionStatus = {
14897
+ IDLE: "idle",
14898
+ STARTING: "starting",
14899
+ RUNNING: "running",
14900
+ STREAMING: "streaming",
14901
+ COMPLETED: "completed",
14902
+ CANCELED: "canceled",
14903
+ INTERRUPTED: "interrupted",
14904
+ FAILED: "failed",
14905
+ RESUMING: "resuming"
14906
+ };
14907
+ SessionStatusSchema = exports_external.enum(SessionStatus);
14908
+ SessionTransitionEvent = {
14909
+ CREATE_SESSION: "create_session",
14910
+ CLI_SPAWNED: "cli_spawned",
14911
+ FIRST_TEXT_DELTA: "first_text_delta",
14912
+ RESULT_RECEIVED: "result_received",
14913
+ USER_STOP: "user_stop",
14914
+ PROCESS_LOST: "process_lost",
14915
+ RESUME: "resume",
14916
+ ERROR: "error"
14917
+ };
14918
+ SessionTransitionEventSchema = exports_external.enum(SessionTransitionEvent);
14919
+ SESSION_TRANSITIONS = [
14920
+ {
14921
+ from: SessionStatus.IDLE,
14922
+ event: SessionTransitionEvent.CREATE_SESSION,
14923
+ to: SessionStatus.STARTING
14924
+ },
14925
+ {
14926
+ from: SessionStatus.STARTING,
14927
+ event: SessionTransitionEvent.CLI_SPAWNED,
14928
+ to: SessionStatus.RUNNING
14929
+ },
14930
+ {
14931
+ from: SessionStatus.STARTING,
14932
+ event: SessionTransitionEvent.ERROR,
14933
+ to: SessionStatus.FAILED
14934
+ },
14935
+ {
14936
+ from: SessionStatus.RUNNING,
14937
+ event: SessionTransitionEvent.FIRST_TEXT_DELTA,
14938
+ to: SessionStatus.STREAMING
14939
+ },
14940
+ {
14941
+ from: SessionStatus.RUNNING,
14942
+ event: SessionTransitionEvent.USER_STOP,
14943
+ to: SessionStatus.CANCELED
14944
+ },
14945
+ {
14946
+ from: SessionStatus.RUNNING,
14947
+ event: SessionTransitionEvent.PROCESS_LOST,
14948
+ to: SessionStatus.INTERRUPTED
14949
+ },
14950
+ {
14951
+ from: SessionStatus.RUNNING,
14952
+ event: SessionTransitionEvent.ERROR,
14953
+ to: SessionStatus.FAILED
14954
+ },
14955
+ {
14956
+ from: SessionStatus.STREAMING,
14957
+ event: SessionTransitionEvent.RESULT_RECEIVED,
14958
+ to: SessionStatus.COMPLETED
14959
+ },
14960
+ {
14961
+ from: SessionStatus.STREAMING,
14962
+ event: SessionTransitionEvent.USER_STOP,
14963
+ to: SessionStatus.CANCELED
14964
+ },
14965
+ {
14966
+ from: SessionStatus.STREAMING,
14967
+ event: SessionTransitionEvent.PROCESS_LOST,
14968
+ to: SessionStatus.INTERRUPTED
14969
+ },
14970
+ {
14971
+ from: SessionStatus.STREAMING,
14972
+ event: SessionTransitionEvent.ERROR,
14973
+ to: SessionStatus.FAILED
14974
+ },
14975
+ {
14976
+ from: SessionStatus.INTERRUPTED,
14977
+ event: SessionTransitionEvent.RESUME,
14978
+ to: SessionStatus.RESUMING
14979
+ },
14980
+ {
14981
+ from: SessionStatus.RESUMING,
14982
+ event: SessionTransitionEvent.CLI_SPAWNED,
14983
+ to: SessionStatus.RUNNING
14984
+ },
14985
+ {
14986
+ from: SessionStatus.RESUMING,
14987
+ event: SessionTransitionEvent.ERROR,
14988
+ to: SessionStatus.FAILED
14989
+ },
14990
+ {
14991
+ from: SessionStatus.COMPLETED,
14992
+ event: SessionTransitionEvent.CREATE_SESSION,
14993
+ to: SessionStatus.STARTING
14994
+ },
14995
+ {
14996
+ from: SessionStatus.CANCELED,
14997
+ event: SessionTransitionEvent.CREATE_SESSION,
14998
+ to: SessionStatus.STARTING
14999
+ },
15000
+ {
15001
+ from: SessionStatus.FAILED,
15002
+ event: SessionTransitionEvent.CREATE_SESSION,
15003
+ to: SessionStatus.STARTING
15004
+ }
15005
+ ];
15006
+ TERMINAL_STATUSES = new Set([
15007
+ SessionStatus.COMPLETED,
15008
+ SessionStatus.CANCELED,
15009
+ SessionStatus.FAILED
15010
+ ]);
15011
+ SessionMetadataSchema = exports_external.object({
15012
+ sessionId: exports_external.string(),
15013
+ status: SessionStatusSchema,
15014
+ model: exports_external.string().optional(),
15015
+ createdAt: exports_external.number(),
15016
+ updatedAt: exports_external.number(),
15017
+ title: exports_external.string().optional()
15018
+ });
15019
+ SessionSummarySchema = exports_external.object({
15020
+ sessionId: exports_external.string(),
15021
+ status: SessionStatusSchema,
15022
+ model: exports_external.string().optional(),
15023
+ title: exports_external.string().optional(),
15024
+ createdAt: exports_external.number(),
15025
+ updatedAt: exports_external.number(),
15026
+ messageCount: exports_external.number(),
15027
+ toolCount: exports_external.number()
15028
+ });
15029
+ });
15030
+
15031
+ // ../shared/src/protocol/host-events.ts
15032
+ var HostEventType, HostEventTypeSchema, TimelineEntryKind, TimelineEntryKindSchema, TimelineEntrySchema, SessionStateEventSchema, TextDeltaEventSchema, ToolStartedEventSchema, ToolCompletedEventSchema, ThinkingEventSchema, ErrorEventSchema, SessionListEventSchema, SessionCompletedEventSchema, HostEventSchema;
15033
+ var init_host_events = __esm(() => {
15034
+ init_zod();
15035
+ init_envelope();
15036
+ init_errors3();
15037
+ init_session();
15038
+ HostEventType = {
15039
+ SESSION_STATE: "session_state",
15040
+ TEXT_DELTA: "text_delta",
15041
+ TOOL_STARTED: "tool_started",
15042
+ TOOL_COMPLETED: "tool_completed",
15043
+ THINKING: "thinking",
15044
+ ERROR: "error",
15045
+ SESSION_LIST: "session_list",
15046
+ SESSION_COMPLETED: "session_completed"
15047
+ };
15048
+ HostEventTypeSchema = exports_external.enum(HostEventType);
15049
+ TimelineEntryKind = {
15050
+ MESSAGE: "message",
15051
+ TOOL_CALL: "tool_call",
15052
+ STATUS: "status",
15053
+ ERROR: "error",
15054
+ DONE: "done"
15055
+ };
15056
+ TimelineEntryKindSchema = exports_external.enum(TimelineEntryKind);
15057
+ TimelineEntrySchema = exports_external.object({
15058
+ id: exports_external.string(),
15059
+ kind: TimelineEntryKindSchema,
15060
+ timestamp: exports_external.number(),
15061
+ data: exports_external.record(exports_external.string(), exports_external.unknown())
15062
+ });
15063
+ SessionStateEventSchema = exports_external.object({
15064
+ protocol: ProtocolVersionSchema,
15065
+ type: exports_external.literal(HostEventType.SESSION_STATE),
15066
+ payload: exports_external.object({
15067
+ sessionId: exports_external.string(),
15068
+ status: SessionStatusSchema,
15069
+ metadata: SessionMetadataSchema.optional(),
15070
+ timeline: exports_external.array(TimelineEntrySchema).optional()
15071
+ })
15072
+ });
15073
+ TextDeltaEventSchema = exports_external.object({
15074
+ protocol: ProtocolVersionSchema,
15075
+ type: exports_external.literal(HostEventType.TEXT_DELTA),
15076
+ payload: exports_external.object({
15077
+ sessionId: exports_external.string(),
15078
+ content: exports_external.string()
15079
+ })
15080
+ });
15081
+ ToolStartedEventSchema = exports_external.object({
15082
+ protocol: ProtocolVersionSchema,
15083
+ type: exports_external.literal(HostEventType.TOOL_STARTED),
15084
+ payload: exports_external.object({
15085
+ sessionId: exports_external.string(),
15086
+ tool: exports_external.string(),
15087
+ toolId: exports_external.string().optional(),
15088
+ parameters: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
15089
+ })
15090
+ });
15091
+ ToolCompletedEventSchema = exports_external.object({
15092
+ protocol: ProtocolVersionSchema,
15093
+ type: exports_external.literal(HostEventType.TOOL_COMPLETED),
15094
+ payload: exports_external.object({
15095
+ sessionId: exports_external.string(),
15096
+ tool: exports_external.string(),
15097
+ toolId: exports_external.string().optional(),
15098
+ result: exports_external.unknown().optional(),
15099
+ duration: exports_external.number().optional(),
15100
+ success: exports_external.boolean(),
15101
+ error: exports_external.string().optional()
15102
+ })
15103
+ });
15104
+ ThinkingEventSchema = exports_external.object({
15105
+ protocol: ProtocolVersionSchema,
15106
+ type: exports_external.literal(HostEventType.THINKING),
15107
+ payload: exports_external.object({
15108
+ sessionId: exports_external.string(),
15109
+ content: exports_external.string().optional()
15110
+ })
15111
+ });
15112
+ ErrorEventSchema = exports_external.object({
15113
+ protocol: ProtocolVersionSchema,
15114
+ type: exports_external.literal(HostEventType.ERROR),
15115
+ payload: exports_external.object({
15116
+ sessionId: exports_external.string().optional(),
15117
+ error: ProtocolErrorSchema
15118
+ })
15119
+ });
15120
+ SessionListEventSchema = exports_external.object({
15121
+ protocol: ProtocolVersionSchema,
15122
+ type: exports_external.literal(HostEventType.SESSION_LIST),
15123
+ payload: exports_external.object({
15124
+ sessions: exports_external.array(SessionSummarySchema)
15125
+ })
15126
+ });
15127
+ SessionCompletedEventSchema = exports_external.object({
15128
+ protocol: ProtocolVersionSchema,
15129
+ type: exports_external.literal(HostEventType.SESSION_COMPLETED),
15130
+ payload: exports_external.object({
15131
+ sessionId: exports_external.string(),
15132
+ summary: exports_external.string().optional()
15133
+ })
15134
+ });
15135
+ HostEventSchema = exports_external.discriminatedUnion("type", [
15136
+ SessionStateEventSchema,
15137
+ TextDeltaEventSchema,
15138
+ ToolStartedEventSchema,
15139
+ ToolCompletedEventSchema,
15140
+ ThinkingEventSchema,
15141
+ ErrorEventSchema,
15142
+ SessionListEventSchema,
15143
+ SessionCompletedEventSchema
15144
+ ]);
15145
+ });
15146
+
15147
+ // ../shared/src/protocol/ui-intents.ts
15148
+ var UIIntentType, UIIntentTypeSchema, SubmitPromptIntentSchema, StopSessionIntentSchema, ResumeSessionIntentSchema, RequestSessionsIntentSchema, RequestSessionDetailIntentSchema, ClearSessionIntentSchema, WebviewReadyIntentSchema, UIIntentSchema;
15149
+ var init_ui_intents = __esm(() => {
15150
+ init_zod();
15151
+ init_context();
15152
+ init_envelope();
15153
+ UIIntentType = {
15154
+ SUBMIT_PROMPT: "submit_prompt",
15155
+ STOP_SESSION: "stop_session",
15156
+ RESUME_SESSION: "resume_session",
15157
+ REQUEST_SESSIONS: "request_sessions",
15158
+ REQUEST_SESSION_DETAIL: "request_session_detail",
15159
+ CLEAR_SESSION: "clear_session",
15160
+ WEBVIEW_READY: "webview_ready"
15161
+ };
15162
+ UIIntentTypeSchema = exports_external.enum(UIIntentType);
15163
+ SubmitPromptIntentSchema = exports_external.object({
15164
+ protocol: ProtocolVersionSchema,
15165
+ type: exports_external.literal(UIIntentType.SUBMIT_PROMPT),
15166
+ payload: exports_external.object({
15167
+ text: exports_external.string().min(1),
15168
+ context: ContextPayloadSchema.optional()
15169
+ })
15170
+ });
15171
+ StopSessionIntentSchema = exports_external.object({
15172
+ protocol: ProtocolVersionSchema,
15173
+ type: exports_external.literal(UIIntentType.STOP_SESSION),
15174
+ payload: exports_external.object({
15175
+ sessionId: exports_external.string()
15176
+ })
15177
+ });
15178
+ ResumeSessionIntentSchema = exports_external.object({
15179
+ protocol: ProtocolVersionSchema,
15180
+ type: exports_external.literal(UIIntentType.RESUME_SESSION),
15181
+ payload: exports_external.object({
15182
+ sessionId: exports_external.string()
15183
+ })
15184
+ });
15185
+ RequestSessionsIntentSchema = exports_external.object({
15186
+ protocol: ProtocolVersionSchema,
15187
+ type: exports_external.literal(UIIntentType.REQUEST_SESSIONS),
15188
+ payload: exports_external.object({}).optional()
15189
+ });
15190
+ RequestSessionDetailIntentSchema = exports_external.object({
15191
+ protocol: ProtocolVersionSchema,
15192
+ type: exports_external.literal(UIIntentType.REQUEST_SESSION_DETAIL),
15193
+ payload: exports_external.object({
15194
+ sessionId: exports_external.string()
15195
+ })
15196
+ });
15197
+ ClearSessionIntentSchema = exports_external.object({
15198
+ protocol: ProtocolVersionSchema,
15199
+ type: exports_external.literal(UIIntentType.CLEAR_SESSION),
15200
+ payload: exports_external.object({
15201
+ sessionId: exports_external.string()
15202
+ })
15203
+ });
15204
+ WebviewReadyIntentSchema = exports_external.object({
15205
+ protocol: ProtocolVersionSchema,
15206
+ type: exports_external.literal(UIIntentType.WEBVIEW_READY),
15207
+ payload: exports_external.object({}).optional()
15208
+ });
15209
+ UIIntentSchema = exports_external.discriminatedUnion("type", [
15210
+ SubmitPromptIntentSchema,
15211
+ StopSessionIntentSchema,
15212
+ ResumeSessionIntentSchema,
15213
+ RequestSessionsIntentSchema,
15214
+ RequestSessionDetailIntentSchema,
15215
+ ClearSessionIntentSchema,
15216
+ WebviewReadyIntentSchema
15217
+ ]);
15218
+ });
15219
+
15220
+ // ../shared/src/protocol/helpers.ts
15221
+ var init_helpers = __esm(() => {
15222
+ init_envelope();
15223
+ init_host_events();
15224
+ init_session();
15225
+ init_ui_intents();
15226
+ });
15227
+
15228
+ // ../shared/src/protocol/index.ts
15229
+ var init_protocol = __esm(() => {
15230
+ init_cli_stream();
15231
+ init_context();
15232
+ init_envelope();
15233
+ init_errors3();
15234
+ init_helpers();
15235
+ init_host_events();
15236
+ init_session();
15237
+ init_ui_intents();
15238
+ });
15239
+
14734
15240
  // ../shared/src/index.ts
14735
15241
  var init_src = __esm(() => {
14736
15242
  init_common();
14737
15243
  init_constants();
14738
15244
  init_enums();
14739
15245
  init_models();
15246
+ init_protocol();
14740
15247
  });
14741
15248
 
14742
15249
  // ../sdk/src/core/config.ts
@@ -15409,14 +15916,16 @@ class CodexRunner {
15409
15916
  projectPath;
15410
15917
  model;
15411
15918
  log;
15919
+ reasoningEffort;
15412
15920
  activeProcess = null;
15413
15921
  eventEmitter;
15414
15922
  currentToolName;
15415
15923
  timeoutMs;
15416
- constructor(projectPath, model = DEFAULT_MODEL[PROVIDER.CODEX], log, timeoutMs) {
15924
+ constructor(projectPath, model = DEFAULT_MODEL[PROVIDER.CODEX], log, timeoutMs, reasoningEffort) {
15417
15925
  this.projectPath = projectPath;
15418
15926
  this.model = model;
15419
15927
  this.log = log;
15928
+ this.reasoningEffort = reasoningEffort;
15420
15929
  this.timeoutMs = timeoutMs ?? DEFAULT_TIMEOUT_MS2;
15421
15930
  }
15422
15931
  setEventEmitter(emitter) {
@@ -15681,6 +16190,9 @@ class CodexRunner {
15681
16190
  if (this.model) {
15682
16191
  args.push("--model", this.model);
15683
16192
  }
16193
+ if (this.reasoningEffort) {
16194
+ args.push("-c", `model_reasoning_effort=${this.reasoningEffort}`);
16195
+ }
15684
16196
  args.push("-");
15685
16197
  return args;
15686
16198
  }
@@ -15735,7 +16247,7 @@ function createAiRunner(provider, config2) {
15735
16247
  const model = config2.model ?? DEFAULT_MODEL[resolvedProvider];
15736
16248
  switch (resolvedProvider) {
15737
16249
  case PROVIDER.CODEX:
15738
- return new CodexRunner(config2.projectPath, model, config2.log, config2.timeoutMs);
16250
+ return new CodexRunner(config2.projectPath, model, config2.log, config2.timeoutMs, config2.reasoningEffort ?? "high");
15739
16251
  default:
15740
16252
  return new ClaudeRunner(config2.projectPath, model, config2.log, config2.timeoutMs);
15741
16253
  }
@@ -15946,7 +16458,7 @@ var toString, getPrototypeOf, iterator, toStringTag, kindOf, kindOfTest = (type)
15946
16458
  }, isDate, isFile, isBlob, isFileList, isStream = (val) => isObject2(val) && isFunction(val.pipe), isFormData = (thing) => {
15947
16459
  let kind;
15948
16460
  return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
15949
- }, isURLSearchParams, isReadableStream, isRequest, isResponse, isHeaders, trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), _global, isContextDefined = (context) => !isUndefined(context) && context !== _global, extend2 = (a, b, thisArg, { allOwnKeys } = {}) => {
16461
+ }, isURLSearchParams, isReadableStream, isRequest, isResponse, isHeaders, trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), _global, isContextDefined = (context2) => !isUndefined(context2) && context2 !== _global, extend2 = (a, b, thisArg, { allOwnKeys } = {}) => {
15950
16462
  forEach(b, (val, key) => {
15951
16463
  if (thisArg && isFunction(val)) {
15952
16464
  Object.defineProperty(a, key, {
@@ -26694,12 +27206,12 @@ var init_platform = __esm(() => {
26694
27206
  // ../../node_modules/axios/lib/helpers/toURLEncodedForm.js
26695
27207
  function toURLEncodedForm(data, options) {
26696
27208
  return toFormData_default(data, new platform_default.classes.URLSearchParams, {
26697
- visitor: function(value, key, path, helpers) {
27209
+ visitor: function(value, key, path, helpers2) {
26698
27210
  if (platform_default.isNode && utils_default.isBuffer(value)) {
26699
27211
  this.append(key, value.toString("base64"));
26700
27212
  return false;
26701
27213
  }
26702
- return helpers.defaultVisitor.apply(this, arguments);
27214
+ return helpers2.defaultVisitor.apply(this, arguments);
26703
27215
  },
26704
27216
  ...options
26705
27217
  });
@@ -26947,7 +27459,7 @@ function parseTokens(str) {
26947
27459
  }
26948
27460
  return tokens;
26949
27461
  }
26950
- function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
27462
+ function matchHeaderValue(context2, value, header, filter2, isHeaderNameFilter) {
26951
27463
  if (utils_default.isFunction(filter2)) {
26952
27464
  return filter2.call(this, value, header);
26953
27465
  }
@@ -27166,9 +27678,9 @@ var init_AxiosHeaders = __esm(() => {
27166
27678
  // ../../node_modules/axios/lib/core/transformData.js
27167
27679
  function transformData(fns, response) {
27168
27680
  const config2 = this || defaults_default;
27169
- const context = response || config2;
27170
- const headers = AxiosHeaders_default.from(context.headers);
27171
- let data = context.data;
27681
+ const context2 = response || config2;
27682
+ const headers = AxiosHeaders_default.from(context2.headers);
27683
+ let data = context2.data;
27172
27684
  utils_default.forEach(fns, function transform2(fn) {
27173
27685
  data = fn.call(config2, data, headers.normalize(), response ? response.status : undefined);
27174
27686
  });
@@ -28274,13 +28786,13 @@ var require_follow_redirects = __commonJS((exports, module) => {
28274
28786
  }
28275
28787
  };
28276
28788
  RedirectableRequest.prototype._performRequest = function() {
28277
- var protocol = this._options.protocol;
28278
- var nativeProtocol = this._options.nativeProtocols[protocol];
28789
+ var protocol2 = this._options.protocol;
28790
+ var nativeProtocol = this._options.nativeProtocols[protocol2];
28279
28791
  if (!nativeProtocol) {
28280
- throw new TypeError("Unsupported protocol " + protocol);
28792
+ throw new TypeError("Unsupported protocol " + protocol2);
28281
28793
  }
28282
28794
  if (this._options.agents) {
28283
- var scheme = protocol.slice(0, -1);
28795
+ var scheme = protocol2.slice(0, -1);
28284
28796
  this._options.agent = this._options.agents[scheme];
28285
28797
  }
28286
28798
  var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
@@ -28377,8 +28889,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
28377
28889
  };
28378
28890
  var nativeProtocols = {};
28379
28891
  Object.keys(protocols).forEach(function(scheme) {
28380
- var protocol = scheme + ":";
28381
- var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
28892
+ var protocol2 = scheme + ":";
28893
+ var nativeProtocol = nativeProtocols[protocol2] = protocols[scheme];
28382
28894
  var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
28383
28895
  function request(input, options, callback) {
28384
28896
  if (isURL(input)) {
@@ -28388,7 +28900,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
28388
28900
  } else {
28389
28901
  callback = options;
28390
28902
  options = validateUrl(input);
28391
- input = { protocol };
28903
+ input = { protocol: protocol2 };
28392
28904
  }
28393
28905
  if (isFunction2(options)) {
28394
28906
  callback = options;
@@ -28402,7 +28914,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
28402
28914
  if (!isString2(options.host) && !isString2(options.hostname)) {
28403
28915
  options.hostname = "::1";
28404
28916
  }
28405
- assert2.equal(options.protocol, protocol, "protocol mismatch");
28917
+ assert2.equal(options.protocol, protocol2, "protocol mismatch");
28406
28918
  debug("options", options);
28407
28919
  return new RedirectableRequest(options, callback);
28408
28920
  }
@@ -28529,12 +29041,12 @@ function parseProtocol(url3) {
28529
29041
  // ../../node_modules/axios/lib/helpers/fromDataURI.js
28530
29042
  function fromDataURI(uri, asBlob, options) {
28531
29043
  const _Blob = options && options.Blob || platform_default.classes.Blob;
28532
- const protocol = parseProtocol(uri);
29044
+ const protocol2 = parseProtocol(uri);
28533
29045
  if (asBlob === undefined && _Blob) {
28534
29046
  asBlob = true;
28535
29047
  }
28536
- if (protocol === "data") {
28537
- uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
29048
+ if (protocol2 === "data") {
29049
+ uri = protocol2.length ? uri.slice(protocol2.length + 1) : uri;
28538
29050
  const match = DATA_URL_PATTERN.exec(uri);
28539
29051
  if (!match) {
28540
29052
  throw new AxiosError_default("Invalid URL", AxiosError_default.ERR_INVALID_URL);
@@ -28551,7 +29063,7 @@ function fromDataURI(uri, asBlob, options) {
28551
29063
  }
28552
29064
  return buffer;
28553
29065
  }
28554
- throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
29066
+ throw new AxiosError_default("Unsupported protocol " + protocol2, AxiosError_default.ERR_NOT_SUPPORT);
28555
29067
  }
28556
29068
  var DATA_URL_PATTERN;
28557
29069
  var init_fromDataURI = __esm(() => {
@@ -29019,7 +29531,7 @@ class Http2Sessions {
29019
29531
  }
29020
29532
  }
29021
29533
  }
29022
- const session = http2.connect(authority, options);
29534
+ const session2 = http2.connect(authority, options);
29023
29535
  let removed;
29024
29536
  const removeSession = () => {
29025
29537
  if (removed) {
@@ -29028,7 +29540,7 @@ class Http2Sessions {
29028
29540
  removed = true;
29029
29541
  let entries = authoritySessions, len = entries.length, i = len;
29030
29542
  while (i--) {
29031
- if (entries[i][0] === session) {
29543
+ if (entries[i][0] === session2) {
29032
29544
  if (len === 1) {
29033
29545
  delete this.sessions[authority];
29034
29546
  } else {
@@ -29038,12 +29550,12 @@ class Http2Sessions {
29038
29550
  }
29039
29551
  }
29040
29552
  };
29041
- const originalRequestFn = session.request;
29553
+ const originalRequestFn = session2.request;
29042
29554
  const { sessionTimeout } = options;
29043
29555
  if (sessionTimeout != null) {
29044
29556
  let timer;
29045
29557
  let streamsCount = 0;
29046
- session.request = function() {
29558
+ session2.request = function() {
29047
29559
  const stream4 = originalRequestFn.apply(this, arguments);
29048
29560
  streamsCount++;
29049
29561
  if (timer) {
@@ -29061,13 +29573,13 @@ class Http2Sessions {
29061
29573
  return stream4;
29062
29574
  };
29063
29575
  }
29064
- session.once("close", removeSession);
29576
+ session2.once("close", removeSession);
29065
29577
  let entry = [
29066
- session,
29578
+ session2,
29067
29579
  options
29068
29580
  ];
29069
29581
  authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
29070
- return session;
29582
+ return session2;
29071
29583
  }
29072
29584
  }
29073
29585
  function dispatchBeforeRedirect(options, responseDetails) {
@@ -29176,8 +29688,8 @@ var init_http = __esm(() => {
29176
29688
  isBrotliSupported = utils_default.isFunction(zlib.createBrotliDecompress);
29177
29689
  ({ http: httpFollow, https: httpsFollow } = import_follow_redirects.default);
29178
29690
  isHttps = /https:?/;
29179
- supportedProtocols = platform_default.protocols.map((protocol) => {
29180
- return protocol + ":";
29691
+ supportedProtocols = platform_default.protocols.map((protocol2) => {
29692
+ return protocol2 + ":";
29181
29693
  });
29182
29694
  http2Sessions = new Http2Sessions;
29183
29695
  isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
@@ -29185,7 +29697,7 @@ var init_http = __esm(() => {
29185
29697
  request(options, cb) {
29186
29698
  const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
29187
29699
  const { http2Options, headers } = options;
29188
- const session = http2Sessions.getSession(authority, http2Options);
29700
+ const session2 = http2Sessions.getSession(authority, http2Options);
29189
29701
  const {
29190
29702
  HTTP2_HEADER_SCHEME,
29191
29703
  HTTP2_HEADER_METHOD,
@@ -29200,7 +29712,7 @@ var init_http = __esm(() => {
29200
29712
  utils_default.forEach(headers, (header, name) => {
29201
29713
  name.charAt(0) !== ":" && (http2Headers[name] = header);
29202
29714
  });
29203
- const req = session.request(http2Headers);
29715
+ const req = session2.request(http2Headers);
29204
29716
  req.once("response", (responseHeaders) => {
29205
29717
  const response = req;
29206
29718
  responseHeaders = Object.assign({}, responseHeaders);
@@ -29284,8 +29796,8 @@ var init_http = __esm(() => {
29284
29796
  });
29285
29797
  const fullPath = buildFullPath(config2.baseURL, config2.url, config2.allowAbsoluteUrls);
29286
29798
  const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : undefined);
29287
- const protocol = parsed.protocol || supportedProtocols[0];
29288
- if (protocol === "data:") {
29799
+ const protocol2 = parsed.protocol || supportedProtocols[0];
29800
+ if (protocol2 === "data:") {
29289
29801
  if (config2.maxContentLength > -1) {
29290
29802
  const dataUrl = String(config2.url || fullPath || "");
29291
29803
  const estimated = estimateDataURLDecodedBytes(dataUrl);
@@ -29325,8 +29837,8 @@ var init_http = __esm(() => {
29325
29837
  config: config2
29326
29838
  });
29327
29839
  }
29328
- if (supportedProtocols.indexOf(protocol) === -1) {
29329
- return reject(new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_BAD_REQUEST, config2));
29840
+ if (supportedProtocols.indexOf(protocol2) === -1) {
29841
+ return reject(new AxiosError_default("Unsupported protocol " + protocol2, AxiosError_default.ERR_BAD_REQUEST, config2));
29330
29842
  }
29331
29843
  const headers = AxiosHeaders_default.from(config2.headers).normalize();
29332
29844
  headers.set("User-Agent", "axios/" + VERSION, false);
@@ -29412,7 +29924,7 @@ var init_http = __esm(() => {
29412
29924
  headers: headers.toJSON(),
29413
29925
  agents: { http: config2.httpAgent, https: config2.httpsAgent },
29414
29926
  auth: auth2,
29415
- protocol,
29927
+ protocol: protocol2,
29416
29928
  family,
29417
29929
  beforeRedirect: dispatchBeforeRedirect,
29418
29930
  beforeRedirects: {},
@@ -29424,7 +29936,7 @@ var init_http = __esm(() => {
29424
29936
  } else {
29425
29937
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
29426
29938
  options.port = parsed.port;
29427
- setProxy(options, config2.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
29939
+ setProxy(options, config2.proxy, protocol2 + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
29428
29940
  }
29429
29941
  let transport;
29430
29942
  const isHttpsRequest = isHttps.test(options.protocol);
@@ -29915,9 +30427,9 @@ var init_xhr = __esm(() => {
29915
30427
  _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
29916
30428
  }
29917
30429
  }
29918
- const protocol = parseProtocol(_config.url);
29919
- if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
29920
- reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config2));
30430
+ const protocol2 = parseProtocol(_config.url);
30431
+ if (protocol2 && platform_default.protocols.indexOf(protocol2) === -1) {
30432
+ reject(new AxiosError_default("Unsupported protocol " + protocol2 + ":", AxiosError_default.ERR_BAD_REQUEST, config2));
29921
30433
  return;
29922
30434
  }
29923
30435
  request.send(requestData || null);
@@ -30763,10 +31275,10 @@ var init_HttpStatusCode = __esm(() => {
30763
31275
 
30764
31276
  // ../../node_modules/axios/lib/axios.js
30765
31277
  function createInstance(defaultConfig) {
30766
- const context = new Axios_default(defaultConfig);
30767
- const instance = bind(Axios_default.prototype.request, context);
30768
- utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
30769
- utils_default.extend(instance, context, null, { allOwnKeys: true });
31278
+ const context2 = new Axios_default(defaultConfig);
31279
+ const instance = bind(Axios_default.prototype.request, context2);
31280
+ utils_default.extend(instance, Axios_default.prototype, context2, { allOwnKeys: true });
31281
+ utils_default.extend(instance, context2, null, { allOwnKeys: true });
30770
31282
  instance.create = function create(instanceConfig) {
30771
31283
  return createInstance(mergeConfig(defaultConfig, instanceConfig));
30772
31284
  };
@@ -31317,11 +31829,11 @@ ${line}`;
31317
31829
  writeFileSync(this.progressPath, updated);
31318
31830
  }
31319
31831
  getFullContext() {
31320
- const context = this.readContext();
31832
+ const context2 = this.readContext();
31321
31833
  const progress = this.readProgress();
31322
31834
  const parts = [];
31323
- if (context.trim()) {
31324
- parts.push(context.trim());
31835
+ if (context2.trim()) {
31836
+ parts.push(context2.trim());
31325
31837
  }
31326
31838
  if (progress.trim()) {
31327
31839
  parts.push(progress.trim());
@@ -31664,10 +32176,10 @@ ${task2.description || "No description provided."}
31664
32176
  let hasLocalContext = false;
31665
32177
  if (existsSync4(contextPath)) {
31666
32178
  try {
31667
- const context = readFileSync4(contextPath, "utf-8");
31668
- if (context.trim().length > 20) {
32179
+ const context2 = readFileSync4(contextPath, "utf-8");
32180
+ if (context2.trim().length > 20) {
31669
32181
  prompt += `## Project Context (Local)
31670
- ${context}
32182
+ ${context2}
31671
32183
 
31672
32184
  `;
31673
32185
  hasLocalContext = true;
@@ -31797,10 +32309,10 @@ ${query}
31797
32309
  let hasLocalContext = false;
31798
32310
  if (existsSync4(contextPath)) {
31799
32311
  try {
31800
- const context = readFileSync4(contextPath, "utf-8");
31801
- if (context.trim().length > 20) {
32312
+ const context2 = readFileSync4(contextPath, "utf-8");
32313
+ if (context2.trim().length > 20) {
31802
32314
  prompt += `## Project Context (Local)
31803
- ${context}
32315
+ ${context2}
31804
32316
 
31805
32317
  `;
31806
32318
  hasLocalContext = true;
@@ -31999,7 +32511,8 @@ function parseWorkerArgs(argv) {
31999
32511
  if (value && !value.startsWith("--"))
32000
32512
  i++;
32001
32513
  config2.provider = resolveProvider(value);
32002
- }
32514
+ } else if (arg === "--reasoning-effort")
32515
+ config2.reasoningEffort = args[++i];
32003
32516
  }
32004
32517
  if (!config2.agentId || !config2.workspaceId || !config2.apiBase || !config2.apiKey || !config2.projectPath) {
32005
32518
  console.error("Missing required arguments");
@@ -32061,7 +32574,8 @@ class AgentWorker {
32061
32574
  this.aiRunner = createAiRunner(provider, {
32062
32575
  projectPath,
32063
32576
  model: config2.model,
32064
- log
32577
+ log,
32578
+ reasoningEffort: config2.reasoningEffort
32065
32579
  });
32066
32580
  this.taskExecutor = new TaskExecutor({
32067
32581
  aiRunner: this.aiRunner,