@locusai/cli 0.11.6 → 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.
- package/bin/agent/worker.js +559 -52
- package/bin/locus.js +838 -268
- package/package.json +2 -2
package/bin/agent/worker.js
CHANGED
|
@@ -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
|
|
@@ -15951,7 +16458,7 @@ var toString, getPrototypeOf, iterator, toStringTag, kindOf, kindOfTest = (type)
|
|
|
15951
16458
|
}, isDate, isFile, isBlob, isFileList, isStream = (val) => isObject2(val) && isFunction(val.pipe), isFormData = (thing) => {
|
|
15952
16459
|
let kind;
|
|
15953
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]"));
|
|
15954
|
-
}, isURLSearchParams, isReadableStream, isRequest, isResponse, isHeaders, trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), _global, isContextDefined = (
|
|
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 } = {}) => {
|
|
15955
16462
|
forEach(b, (val, key) => {
|
|
15956
16463
|
if (thisArg && isFunction(val)) {
|
|
15957
16464
|
Object.defineProperty(a, key, {
|
|
@@ -26699,12 +27206,12 @@ var init_platform = __esm(() => {
|
|
|
26699
27206
|
// ../../node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
26700
27207
|
function toURLEncodedForm(data, options) {
|
|
26701
27208
|
return toFormData_default(data, new platform_default.classes.URLSearchParams, {
|
|
26702
|
-
visitor: function(value, key, path,
|
|
27209
|
+
visitor: function(value, key, path, helpers2) {
|
|
26703
27210
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
26704
27211
|
this.append(key, value.toString("base64"));
|
|
26705
27212
|
return false;
|
|
26706
27213
|
}
|
|
26707
|
-
return
|
|
27214
|
+
return helpers2.defaultVisitor.apply(this, arguments);
|
|
26708
27215
|
},
|
|
26709
27216
|
...options
|
|
26710
27217
|
});
|
|
@@ -26952,7 +27459,7 @@ function parseTokens(str) {
|
|
|
26952
27459
|
}
|
|
26953
27460
|
return tokens;
|
|
26954
27461
|
}
|
|
26955
|
-
function matchHeaderValue(
|
|
27462
|
+
function matchHeaderValue(context2, value, header, filter2, isHeaderNameFilter) {
|
|
26956
27463
|
if (utils_default.isFunction(filter2)) {
|
|
26957
27464
|
return filter2.call(this, value, header);
|
|
26958
27465
|
}
|
|
@@ -27171,9 +27678,9 @@ var init_AxiosHeaders = __esm(() => {
|
|
|
27171
27678
|
// ../../node_modules/axios/lib/core/transformData.js
|
|
27172
27679
|
function transformData(fns, response) {
|
|
27173
27680
|
const config2 = this || defaults_default;
|
|
27174
|
-
const
|
|
27175
|
-
const headers = AxiosHeaders_default.from(
|
|
27176
|
-
let data =
|
|
27681
|
+
const context2 = response || config2;
|
|
27682
|
+
const headers = AxiosHeaders_default.from(context2.headers);
|
|
27683
|
+
let data = context2.data;
|
|
27177
27684
|
utils_default.forEach(fns, function transform2(fn) {
|
|
27178
27685
|
data = fn.call(config2, data, headers.normalize(), response ? response.status : undefined);
|
|
27179
27686
|
});
|
|
@@ -28279,13 +28786,13 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
28279
28786
|
}
|
|
28280
28787
|
};
|
|
28281
28788
|
RedirectableRequest.prototype._performRequest = function() {
|
|
28282
|
-
var
|
|
28283
|
-
var nativeProtocol = this._options.nativeProtocols[
|
|
28789
|
+
var protocol2 = this._options.protocol;
|
|
28790
|
+
var nativeProtocol = this._options.nativeProtocols[protocol2];
|
|
28284
28791
|
if (!nativeProtocol) {
|
|
28285
|
-
throw new TypeError("Unsupported protocol " +
|
|
28792
|
+
throw new TypeError("Unsupported protocol " + protocol2);
|
|
28286
28793
|
}
|
|
28287
28794
|
if (this._options.agents) {
|
|
28288
|
-
var scheme =
|
|
28795
|
+
var scheme = protocol2.slice(0, -1);
|
|
28289
28796
|
this._options.agent = this._options.agents[scheme];
|
|
28290
28797
|
}
|
|
28291
28798
|
var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
|
|
@@ -28382,8 +28889,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
28382
28889
|
};
|
|
28383
28890
|
var nativeProtocols = {};
|
|
28384
28891
|
Object.keys(protocols).forEach(function(scheme) {
|
|
28385
|
-
var
|
|
28386
|
-
var nativeProtocol = nativeProtocols[
|
|
28892
|
+
var protocol2 = scheme + ":";
|
|
28893
|
+
var nativeProtocol = nativeProtocols[protocol2] = protocols[scheme];
|
|
28387
28894
|
var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
|
|
28388
28895
|
function request(input, options, callback) {
|
|
28389
28896
|
if (isURL(input)) {
|
|
@@ -28393,7 +28900,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
28393
28900
|
} else {
|
|
28394
28901
|
callback = options;
|
|
28395
28902
|
options = validateUrl(input);
|
|
28396
|
-
input = { protocol };
|
|
28903
|
+
input = { protocol: protocol2 };
|
|
28397
28904
|
}
|
|
28398
28905
|
if (isFunction2(options)) {
|
|
28399
28906
|
callback = options;
|
|
@@ -28407,7 +28914,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
28407
28914
|
if (!isString2(options.host) && !isString2(options.hostname)) {
|
|
28408
28915
|
options.hostname = "::1";
|
|
28409
28916
|
}
|
|
28410
|
-
assert2.equal(options.protocol,
|
|
28917
|
+
assert2.equal(options.protocol, protocol2, "protocol mismatch");
|
|
28411
28918
|
debug("options", options);
|
|
28412
28919
|
return new RedirectableRequest(options, callback);
|
|
28413
28920
|
}
|
|
@@ -28534,12 +29041,12 @@ function parseProtocol(url3) {
|
|
|
28534
29041
|
// ../../node_modules/axios/lib/helpers/fromDataURI.js
|
|
28535
29042
|
function fromDataURI(uri, asBlob, options) {
|
|
28536
29043
|
const _Blob = options && options.Blob || platform_default.classes.Blob;
|
|
28537
|
-
const
|
|
29044
|
+
const protocol2 = parseProtocol(uri);
|
|
28538
29045
|
if (asBlob === undefined && _Blob) {
|
|
28539
29046
|
asBlob = true;
|
|
28540
29047
|
}
|
|
28541
|
-
if (
|
|
28542
|
-
uri =
|
|
29048
|
+
if (protocol2 === "data") {
|
|
29049
|
+
uri = protocol2.length ? uri.slice(protocol2.length + 1) : uri;
|
|
28543
29050
|
const match = DATA_URL_PATTERN.exec(uri);
|
|
28544
29051
|
if (!match) {
|
|
28545
29052
|
throw new AxiosError_default("Invalid URL", AxiosError_default.ERR_INVALID_URL);
|
|
@@ -28556,7 +29063,7 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
28556
29063
|
}
|
|
28557
29064
|
return buffer;
|
|
28558
29065
|
}
|
|
28559
|
-
throw new AxiosError_default("Unsupported protocol " +
|
|
29066
|
+
throw new AxiosError_default("Unsupported protocol " + protocol2, AxiosError_default.ERR_NOT_SUPPORT);
|
|
28560
29067
|
}
|
|
28561
29068
|
var DATA_URL_PATTERN;
|
|
28562
29069
|
var init_fromDataURI = __esm(() => {
|
|
@@ -29024,7 +29531,7 @@ class Http2Sessions {
|
|
|
29024
29531
|
}
|
|
29025
29532
|
}
|
|
29026
29533
|
}
|
|
29027
|
-
const
|
|
29534
|
+
const session2 = http2.connect(authority, options);
|
|
29028
29535
|
let removed;
|
|
29029
29536
|
const removeSession = () => {
|
|
29030
29537
|
if (removed) {
|
|
@@ -29033,7 +29540,7 @@ class Http2Sessions {
|
|
|
29033
29540
|
removed = true;
|
|
29034
29541
|
let entries = authoritySessions, len = entries.length, i = len;
|
|
29035
29542
|
while (i--) {
|
|
29036
|
-
if (entries[i][0] ===
|
|
29543
|
+
if (entries[i][0] === session2) {
|
|
29037
29544
|
if (len === 1) {
|
|
29038
29545
|
delete this.sessions[authority];
|
|
29039
29546
|
} else {
|
|
@@ -29043,12 +29550,12 @@ class Http2Sessions {
|
|
|
29043
29550
|
}
|
|
29044
29551
|
}
|
|
29045
29552
|
};
|
|
29046
|
-
const originalRequestFn =
|
|
29553
|
+
const originalRequestFn = session2.request;
|
|
29047
29554
|
const { sessionTimeout } = options;
|
|
29048
29555
|
if (sessionTimeout != null) {
|
|
29049
29556
|
let timer;
|
|
29050
29557
|
let streamsCount = 0;
|
|
29051
|
-
|
|
29558
|
+
session2.request = function() {
|
|
29052
29559
|
const stream4 = originalRequestFn.apply(this, arguments);
|
|
29053
29560
|
streamsCount++;
|
|
29054
29561
|
if (timer) {
|
|
@@ -29066,13 +29573,13 @@ class Http2Sessions {
|
|
|
29066
29573
|
return stream4;
|
|
29067
29574
|
};
|
|
29068
29575
|
}
|
|
29069
|
-
|
|
29576
|
+
session2.once("close", removeSession);
|
|
29070
29577
|
let entry = [
|
|
29071
|
-
|
|
29578
|
+
session2,
|
|
29072
29579
|
options
|
|
29073
29580
|
];
|
|
29074
29581
|
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
29075
|
-
return
|
|
29582
|
+
return session2;
|
|
29076
29583
|
}
|
|
29077
29584
|
}
|
|
29078
29585
|
function dispatchBeforeRedirect(options, responseDetails) {
|
|
@@ -29181,8 +29688,8 @@ var init_http = __esm(() => {
|
|
|
29181
29688
|
isBrotliSupported = utils_default.isFunction(zlib.createBrotliDecompress);
|
|
29182
29689
|
({ http: httpFollow, https: httpsFollow } = import_follow_redirects.default);
|
|
29183
29690
|
isHttps = /https:?/;
|
|
29184
|
-
supportedProtocols = platform_default.protocols.map((
|
|
29185
|
-
return
|
|
29691
|
+
supportedProtocols = platform_default.protocols.map((protocol2) => {
|
|
29692
|
+
return protocol2 + ":";
|
|
29186
29693
|
});
|
|
29187
29694
|
http2Sessions = new Http2Sessions;
|
|
29188
29695
|
isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
@@ -29190,7 +29697,7 @@ var init_http = __esm(() => {
|
|
|
29190
29697
|
request(options, cb) {
|
|
29191
29698
|
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
29192
29699
|
const { http2Options, headers } = options;
|
|
29193
|
-
const
|
|
29700
|
+
const session2 = http2Sessions.getSession(authority, http2Options);
|
|
29194
29701
|
const {
|
|
29195
29702
|
HTTP2_HEADER_SCHEME,
|
|
29196
29703
|
HTTP2_HEADER_METHOD,
|
|
@@ -29205,7 +29712,7 @@ var init_http = __esm(() => {
|
|
|
29205
29712
|
utils_default.forEach(headers, (header, name) => {
|
|
29206
29713
|
name.charAt(0) !== ":" && (http2Headers[name] = header);
|
|
29207
29714
|
});
|
|
29208
|
-
const req =
|
|
29715
|
+
const req = session2.request(http2Headers);
|
|
29209
29716
|
req.once("response", (responseHeaders) => {
|
|
29210
29717
|
const response = req;
|
|
29211
29718
|
responseHeaders = Object.assign({}, responseHeaders);
|
|
@@ -29289,8 +29796,8 @@ var init_http = __esm(() => {
|
|
|
29289
29796
|
});
|
|
29290
29797
|
const fullPath = buildFullPath(config2.baseURL, config2.url, config2.allowAbsoluteUrls);
|
|
29291
29798
|
const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : undefined);
|
|
29292
|
-
const
|
|
29293
|
-
if (
|
|
29799
|
+
const protocol2 = parsed.protocol || supportedProtocols[0];
|
|
29800
|
+
if (protocol2 === "data:") {
|
|
29294
29801
|
if (config2.maxContentLength > -1) {
|
|
29295
29802
|
const dataUrl = String(config2.url || fullPath || "");
|
|
29296
29803
|
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
@@ -29330,8 +29837,8 @@ var init_http = __esm(() => {
|
|
|
29330
29837
|
config: config2
|
|
29331
29838
|
});
|
|
29332
29839
|
}
|
|
29333
|
-
if (supportedProtocols.indexOf(
|
|
29334
|
-
return reject(new AxiosError_default("Unsupported protocol " +
|
|
29840
|
+
if (supportedProtocols.indexOf(protocol2) === -1) {
|
|
29841
|
+
return reject(new AxiosError_default("Unsupported protocol " + protocol2, AxiosError_default.ERR_BAD_REQUEST, config2));
|
|
29335
29842
|
}
|
|
29336
29843
|
const headers = AxiosHeaders_default.from(config2.headers).normalize();
|
|
29337
29844
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
@@ -29417,7 +29924,7 @@ var init_http = __esm(() => {
|
|
|
29417
29924
|
headers: headers.toJSON(),
|
|
29418
29925
|
agents: { http: config2.httpAgent, https: config2.httpsAgent },
|
|
29419
29926
|
auth: auth2,
|
|
29420
|
-
protocol,
|
|
29927
|
+
protocol: protocol2,
|
|
29421
29928
|
family,
|
|
29422
29929
|
beforeRedirect: dispatchBeforeRedirect,
|
|
29423
29930
|
beforeRedirects: {},
|
|
@@ -29429,7 +29936,7 @@ var init_http = __esm(() => {
|
|
|
29429
29936
|
} else {
|
|
29430
29937
|
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
29431
29938
|
options.port = parsed.port;
|
|
29432
|
-
setProxy(options, config2.proxy,
|
|
29939
|
+
setProxy(options, config2.proxy, protocol2 + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
29433
29940
|
}
|
|
29434
29941
|
let transport;
|
|
29435
29942
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
@@ -29920,9 +30427,9 @@ var init_xhr = __esm(() => {
|
|
|
29920
30427
|
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
29921
30428
|
}
|
|
29922
30429
|
}
|
|
29923
|
-
const
|
|
29924
|
-
if (
|
|
29925
|
-
reject(new AxiosError_default("Unsupported protocol " +
|
|
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));
|
|
29926
30433
|
return;
|
|
29927
30434
|
}
|
|
29928
30435
|
request.send(requestData || null);
|
|
@@ -30768,10 +31275,10 @@ var init_HttpStatusCode = __esm(() => {
|
|
|
30768
31275
|
|
|
30769
31276
|
// ../../node_modules/axios/lib/axios.js
|
|
30770
31277
|
function createInstance(defaultConfig) {
|
|
30771
|
-
const
|
|
30772
|
-
const instance = bind(Axios_default.prototype.request,
|
|
30773
|
-
utils_default.extend(instance, Axios_default.prototype,
|
|
30774
|
-
utils_default.extend(instance,
|
|
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 });
|
|
30775
31282
|
instance.create = function create(instanceConfig) {
|
|
30776
31283
|
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
30777
31284
|
};
|
|
@@ -31322,11 +31829,11 @@ ${line}`;
|
|
|
31322
31829
|
writeFileSync(this.progressPath, updated);
|
|
31323
31830
|
}
|
|
31324
31831
|
getFullContext() {
|
|
31325
|
-
const
|
|
31832
|
+
const context2 = this.readContext();
|
|
31326
31833
|
const progress = this.readProgress();
|
|
31327
31834
|
const parts = [];
|
|
31328
|
-
if (
|
|
31329
|
-
parts.push(
|
|
31835
|
+
if (context2.trim()) {
|
|
31836
|
+
parts.push(context2.trim());
|
|
31330
31837
|
}
|
|
31331
31838
|
if (progress.trim()) {
|
|
31332
31839
|
parts.push(progress.trim());
|
|
@@ -31669,10 +32176,10 @@ ${task2.description || "No description provided."}
|
|
|
31669
32176
|
let hasLocalContext = false;
|
|
31670
32177
|
if (existsSync4(contextPath)) {
|
|
31671
32178
|
try {
|
|
31672
|
-
const
|
|
31673
|
-
if (
|
|
32179
|
+
const context2 = readFileSync4(contextPath, "utf-8");
|
|
32180
|
+
if (context2.trim().length > 20) {
|
|
31674
32181
|
prompt += `## Project Context (Local)
|
|
31675
|
-
${
|
|
32182
|
+
${context2}
|
|
31676
32183
|
|
|
31677
32184
|
`;
|
|
31678
32185
|
hasLocalContext = true;
|
|
@@ -31802,10 +32309,10 @@ ${query}
|
|
|
31802
32309
|
let hasLocalContext = false;
|
|
31803
32310
|
if (existsSync4(contextPath)) {
|
|
31804
32311
|
try {
|
|
31805
|
-
const
|
|
31806
|
-
if (
|
|
32312
|
+
const context2 = readFileSync4(contextPath, "utf-8");
|
|
32313
|
+
if (context2.trim().length > 20) {
|
|
31807
32314
|
prompt += `## Project Context (Local)
|
|
31808
|
-
${
|
|
32315
|
+
${context2}
|
|
31809
32316
|
|
|
31810
32317
|
`;
|
|
31811
32318
|
hasLocalContext = true;
|