@denizokcu/haze 1.1.0 → 1.2.0
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/CHANGELOG.md +49 -1
- package/README.md +17 -10
- package/SECURITY.md +1 -1
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/busyIndicator.d.ts +11 -0
- package/dist/cli/chat/busyIndicator.js +34 -0
- package/dist/cli/chat/chatMetrics.d.ts +0 -1
- package/dist/cli/chat/chatMetrics.js +1 -7
- package/dist/cli/chat/followUpQueue.d.ts +11 -0
- package/dist/cli/chat/followUpQueue.js +38 -0
- package/dist/cli/chat/messages.d.ts +0 -22
- package/dist/cli/chat/messages.js +40 -85
- package/dist/cli/chat/sessionLifecycle.d.ts +3 -1
- package/dist/cli/chat/sessionLifecycle.js +8 -1
- package/dist/cli/chat/sessionRecorder.d.ts +9 -0
- package/dist/cli/chat/sessionRecorder.js +12 -0
- package/dist/cli/chat/startupSequence.d.ts +29 -0
- package/dist/cli/chat/startupSequence.js +59 -0
- package/dist/cli/chat/transcriptPartition.d.ts +23 -0
- package/dist/cli/chat/transcriptPartition.js +78 -0
- package/dist/cli/chat/wizard/fieldTransitions.d.ts +38 -0
- package/dist/cli/chat/wizard/fieldTransitions.js +43 -0
- package/dist/cli/chat/wizard/lspHandlers.d.ts +4 -0
- package/dist/cli/chat/wizard/lspHandlers.js +85 -0
- package/dist/cli/chat/wizard/mcpHandlers.d.ts +8 -0
- package/dist/cli/chat/wizard/mcpHandlers.js +82 -0
- package/dist/cli/chat/wizard/providerHandlers.d.ts +12 -0
- package/dist/cli/chat/wizard/providerHandlers.js +420 -0
- package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +4 -0
- package/dist/cli/chat/wizard/sessionThemeHandlers.js +48 -0
- package/dist/cli/chat/wizard/skillsHandlers.d.ts +4 -0
- package/dist/cli/chat/wizard/skillsHandlers.js +125 -0
- package/dist/cli/chat/wizard/types.d.ts +63 -0
- package/dist/cli/chat/wizard/types.js +24 -0
- package/dist/cli/chat/wizard/uiState.d.ts +56 -0
- package/dist/cli/chat/wizard/uiState.js +15 -0
- package/dist/cli/chat/wizardDispatch.d.ts +11 -113
- package/dist/cli/chat/wizardDispatch.js +41 -815
- package/dist/cli/commands/chat.js +69 -110
- package/dist/cli/commands/formatters.d.ts +0 -3
- package/dist/cli/commands/formatters.js +0 -29
- package/dist/cli/commands/runCommand.d.ts +2 -0
- package/dist/cli/commands/runCommand.js +73 -4
- package/dist/cli/commands/streaming/agentAttempt.d.ts +11 -1
- package/dist/cli/commands/streaming/agentAttempt.js +9 -5
- package/dist/cli/commands/streaming/assistantSegments.d.ts +19 -0
- package/dist/cli/commands/streaming/assistantSegments.js +48 -0
- package/dist/cli/commands/streaming/attemptOutcome.d.ts +25 -5
- package/dist/cli/commands/streaming/attemptOutcome.js +69 -16
- package/dist/cli/commands/streaming/attemptSetup.d.ts +10 -3
- package/dist/cli/commands/streaming/attemptSetup.js +30 -13
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +69 -8
- package/dist/cli/commands/streaming/goalCheckpoint.js +36 -1
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +18 -3
- package/dist/cli/commands/streaming/goalSupervisor.js +71 -12
- package/dist/cli/commands/streaming/prepareStep.d.ts +40 -0
- package/dist/cli/commands/streaming/prepareStep.js +116 -0
- package/dist/cli/commands/streaming/recoverySlices.d.ts +15 -0
- package/dist/cli/commands/streaming/recoverySlices.js +29 -0
- package/dist/cli/commands/streaming/stallRecovery.d.ts +0 -1
- package/dist/cli/commands/streaming/stallRecovery.js +2 -6
- package/dist/cli/commands/streaming/streamLoop.d.ts +31 -4
- package/dist/cli/commands/streaming/streamLoop.js +283 -268
- package/dist/cli/commands/streaming/toolGroupRenderer.js +2 -1
- package/dist/cli/commands/streaming/toolPartHandlers.d.ts +19 -0
- package/dist/cli/commands/streaming/toolPartHandlers.js +108 -0
- package/dist/cli/commands/streaming/turnRuntime.d.ts +1 -1
- package/dist/cli/commands/streaming/turnRuntime.js +3 -2
- package/dist/cli/commands/streaming.d.ts +12 -1
- package/dist/cli/commands/streaming.js +20 -25
- package/dist/cli/index.js +6 -3
- package/dist/config/modelCatalog.d.ts +32 -0
- package/dist/config/modelCatalog.js +84 -0
- package/dist/config/providerPresets.d.ts +7 -0
- package/dist/config/providerPresets.js +195 -391
- package/dist/config/settings.d.ts +10 -2
- package/dist/config/settings.js +3 -0
- package/dist/core/agent/budgets.d.ts +10 -0
- package/dist/core/agent/budgets.js +10 -0
- package/dist/core/agent/compaction.d.ts +42 -3
- package/dist/core/agent/compaction.js +53 -5
- package/dist/core/agent/completionController.d.ts +16 -7
- package/dist/core/agent/completionController.js +13 -6
- package/dist/core/agent/contextBudget.d.ts +56 -0
- package/dist/core/agent/contextBudget.js +53 -0
- package/dist/core/agent/errors.js +2 -2
- package/dist/core/agent/events.d.ts +36 -1
- package/dist/core/agent/goalPolicy.d.ts +4 -3
- package/dist/core/agent/goalPolicy.js +9 -4
- package/dist/core/agent/overflow.d.ts +45 -0
- package/dist/core/agent/overflow.js +91 -0
- package/dist/core/agent/requestAssembly.d.ts +7 -0
- package/dist/core/agent/requestAssembly.js +15 -7
- package/dist/core/agent/workState.d.ts +25 -15
- package/dist/core/agent/workState.js +84 -44
- package/dist/core/safety/shellClassifier.d.ts +16 -0
- package/dist/core/safety/shellClassifier.js +31 -0
- package/dist/core/session/sessionSlimming.js +8 -0
- package/dist/core/session/sessionStore.d.ts +71 -1
- package/dist/core/session/sessionStore.js +121 -6
- package/dist/core/validation/outputParser.d.ts +1 -1
- package/dist/core/validation/outputParser.js +6 -1
- package/dist/llm/client.d.ts +2 -2
- package/dist/llm/client.js +14 -6
- package/dist/llm/hazeTools.d.ts +64 -208
- package/dist/llm/tools/shellTool.js +27 -8
- package/dist/llm/tools/taskTool.d.ts +64 -208
- package/dist/llm/tools/taskTool.js +22 -10
- package/dist/ui/components/TextInput.d.ts +18 -1
- package/dist/ui/components/TextInput.js +50 -73
- package/dist/ui/components/useInputSuggestions.d.ts +27 -0
- package/dist/ui/components/useInputSuggestions.js +98 -0
- package/dist/ui/theme.d.ts +8 -8
- package/dist/ui/theme.js +11 -12
- package/dist/ui/themes/registry.d.ts +5 -0
- package/dist/ui/themes/registry.js +436 -0
- package/dist/utils/format.d.ts +10 -0
- package/dist/utils/format.js +45 -0
- package/package.json +16 -15
- package/dist/ui/themes/af-magic.d.ts +0 -7
- package/dist/ui/themes/af-magic.js +0 -25
- package/dist/ui/themes/agnoster.d.ts +0 -10
- package/dist/ui/themes/agnoster.js +0 -40
- package/dist/ui/themes/bira.d.ts +0 -10
- package/dist/ui/themes/bira.js +0 -28
- package/dist/ui/themes/bureau.d.ts +0 -10
- package/dist/ui/themes/bureau.js +0 -28
- package/dist/ui/themes/clean.d.ts +0 -9
- package/dist/ui/themes/clean.js +0 -27
- package/dist/ui/themes/cloud.d.ts +0 -6
- package/dist/ui/themes/cloud.js +0 -24
- package/dist/ui/themes/dst.d.ts +0 -10
- package/dist/ui/themes/dst.js +0 -28
- package/dist/ui/themes/fishy.d.ts +0 -7
- package/dist/ui/themes/fishy.js +0 -25
- package/dist/ui/themes/index.d.ts +0 -8
- package/dist/ui/themes/index.js +0 -36
- package/dist/ui/themes/light.d.ts +0 -3
- package/dist/ui/themes/light.js +0 -21
- package/dist/ui/themes/purple.d.ts +0 -7
- package/dist/ui/themes/purple.js +0 -26
- package/dist/ui/themes/robbyrussell.d.ts +0 -8
- package/dist/ui/themes/robbyrussell.js +0 -26
- package/dist/ui/themes/solarized-dark.d.ts +0 -16
- package/dist/ui/themes/solarized-dark.js +0 -44
- package/dist/ui/themes/solarized-light.d.ts +0 -12
- package/dist/ui/themes/solarized-light.js +0 -40
- package/dist/ui/themes/steeef.d.ts +0 -11
- package/dist/ui/themes/steeef.js +0 -29
package/dist/llm/hazeTools.d.ts
CHANGED
|
@@ -5802,24 +5802,15 @@ export declare const hazeTools: {
|
|
|
5802
5802
|
output: NoInfer<{
|
|
5803
5803
|
ok: boolean;
|
|
5804
5804
|
error: string;
|
|
5805
|
-
taskCount?: undefined;
|
|
5806
|
-
summary?: undefined;
|
|
5807
|
-
counts?: undefined;
|
|
5808
5805
|
} | {
|
|
5809
|
-
ok: boolean;
|
|
5810
|
-
taskCount: number;
|
|
5811
5806
|
summary: string;
|
|
5812
|
-
|
|
5813
|
-
counts?: undefined;
|
|
5814
|
-
} | {
|
|
5815
|
-
ok: boolean;
|
|
5816
|
-
taskCount: number;
|
|
5817
|
-
counts: {
|
|
5807
|
+
counts?: {
|
|
5818
5808
|
pending: number;
|
|
5819
5809
|
in_progress: number;
|
|
5820
5810
|
completed: number;
|
|
5821
|
-
};
|
|
5822
|
-
|
|
5811
|
+
} | undefined;
|
|
5812
|
+
ok: boolean;
|
|
5813
|
+
taskCount: number;
|
|
5823
5814
|
error?: undefined;
|
|
5824
5815
|
}>;
|
|
5825
5816
|
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
@@ -5827,24 +5818,15 @@ export declare const hazeTools: {
|
|
|
5827
5818
|
outputSchema?: import("ai").FlexibleSchema<{
|
|
5828
5819
|
ok: boolean;
|
|
5829
5820
|
error: string;
|
|
5830
|
-
taskCount?: undefined;
|
|
5831
|
-
summary?: undefined;
|
|
5832
|
-
counts?: undefined;
|
|
5833
5821
|
} | {
|
|
5834
|
-
ok: boolean;
|
|
5835
|
-
taskCount: number;
|
|
5836
5822
|
summary: string;
|
|
5837
|
-
|
|
5838
|
-
counts?: undefined;
|
|
5839
|
-
} | {
|
|
5840
|
-
ok: boolean;
|
|
5841
|
-
taskCount: number;
|
|
5842
|
-
counts: {
|
|
5823
|
+
counts?: {
|
|
5843
5824
|
pending: number;
|
|
5844
5825
|
in_progress: number;
|
|
5845
5826
|
completed: number;
|
|
5846
|
-
};
|
|
5847
|
-
|
|
5827
|
+
} | undefined;
|
|
5828
|
+
ok: boolean;
|
|
5829
|
+
taskCount: number;
|
|
5848
5830
|
error?: undefined;
|
|
5849
5831
|
}> | undefined;
|
|
5850
5832
|
execute: import("ai").ToolExecuteFunction<{
|
|
@@ -5855,24 +5837,15 @@ export declare const hazeTools: {
|
|
|
5855
5837
|
}, {
|
|
5856
5838
|
ok: boolean;
|
|
5857
5839
|
error: string;
|
|
5858
|
-
taskCount?: undefined;
|
|
5859
|
-
summary?: undefined;
|
|
5860
|
-
counts?: undefined;
|
|
5861
5840
|
} | {
|
|
5862
|
-
ok: boolean;
|
|
5863
|
-
taskCount: number;
|
|
5864
5841
|
summary: string;
|
|
5865
|
-
|
|
5866
|
-
counts?: undefined;
|
|
5867
|
-
} | {
|
|
5868
|
-
ok: boolean;
|
|
5869
|
-
taskCount: number;
|
|
5870
|
-
counts: {
|
|
5842
|
+
counts?: {
|
|
5871
5843
|
pending: number;
|
|
5872
5844
|
in_progress: number;
|
|
5873
5845
|
completed: number;
|
|
5874
|
-
};
|
|
5875
|
-
|
|
5846
|
+
} | undefined;
|
|
5847
|
+
ok: boolean;
|
|
5848
|
+
taskCount: number;
|
|
5876
5849
|
error?: undefined;
|
|
5877
5850
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
5878
5851
|
} & {
|
|
@@ -5904,24 +5877,15 @@ export declare const hazeTools: {
|
|
|
5904
5877
|
}, {
|
|
5905
5878
|
ok: boolean;
|
|
5906
5879
|
error: string;
|
|
5907
|
-
taskCount?: undefined;
|
|
5908
|
-
summary?: undefined;
|
|
5909
|
-
counts?: undefined;
|
|
5910
5880
|
} | {
|
|
5911
|
-
ok: boolean;
|
|
5912
|
-
taskCount: number;
|
|
5913
5881
|
summary: string;
|
|
5914
|
-
|
|
5915
|
-
counts?: undefined;
|
|
5916
|
-
} | {
|
|
5917
|
-
ok: boolean;
|
|
5918
|
-
taskCount: number;
|
|
5919
|
-
counts: {
|
|
5882
|
+
counts?: {
|
|
5920
5883
|
pending: number;
|
|
5921
5884
|
in_progress: number;
|
|
5922
5885
|
completed: number;
|
|
5923
|
-
};
|
|
5924
|
-
|
|
5886
|
+
} | undefined;
|
|
5887
|
+
ok: boolean;
|
|
5888
|
+
taskCount: number;
|
|
5925
5889
|
error?: undefined;
|
|
5926
5890
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
5927
5891
|
}) | ({
|
|
@@ -5964,24 +5928,15 @@ export declare const hazeTools: {
|
|
|
5964
5928
|
output: NoInfer<{
|
|
5965
5929
|
ok: boolean;
|
|
5966
5930
|
error: string;
|
|
5967
|
-
taskCount?: undefined;
|
|
5968
|
-
summary?: undefined;
|
|
5969
|
-
counts?: undefined;
|
|
5970
5931
|
} | {
|
|
5971
|
-
ok: boolean;
|
|
5972
|
-
taskCount: number;
|
|
5973
5932
|
summary: string;
|
|
5974
|
-
|
|
5975
|
-
counts?: undefined;
|
|
5976
|
-
} | {
|
|
5977
|
-
ok: boolean;
|
|
5978
|
-
taskCount: number;
|
|
5979
|
-
counts: {
|
|
5933
|
+
counts?: {
|
|
5980
5934
|
pending: number;
|
|
5981
5935
|
in_progress: number;
|
|
5982
5936
|
completed: number;
|
|
5983
|
-
};
|
|
5984
|
-
|
|
5937
|
+
} | undefined;
|
|
5938
|
+
ok: boolean;
|
|
5939
|
+
taskCount: number;
|
|
5985
5940
|
error?: undefined;
|
|
5986
5941
|
}>;
|
|
5987
5942
|
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
@@ -5989,24 +5944,15 @@ export declare const hazeTools: {
|
|
|
5989
5944
|
outputSchema?: import("ai").FlexibleSchema<{
|
|
5990
5945
|
ok: boolean;
|
|
5991
5946
|
error: string;
|
|
5992
|
-
taskCount?: undefined;
|
|
5993
|
-
summary?: undefined;
|
|
5994
|
-
counts?: undefined;
|
|
5995
5947
|
} | {
|
|
5996
|
-
ok: boolean;
|
|
5997
|
-
taskCount: number;
|
|
5998
5948
|
summary: string;
|
|
5999
|
-
|
|
6000
|
-
counts?: undefined;
|
|
6001
|
-
} | {
|
|
6002
|
-
ok: boolean;
|
|
6003
|
-
taskCount: number;
|
|
6004
|
-
counts: {
|
|
5949
|
+
counts?: {
|
|
6005
5950
|
pending: number;
|
|
6006
5951
|
in_progress: number;
|
|
6007
5952
|
completed: number;
|
|
6008
|
-
};
|
|
6009
|
-
|
|
5953
|
+
} | undefined;
|
|
5954
|
+
ok: boolean;
|
|
5955
|
+
taskCount: number;
|
|
6010
5956
|
error?: undefined;
|
|
6011
5957
|
}> | undefined;
|
|
6012
5958
|
execute: import("ai").ToolExecuteFunction<{
|
|
@@ -6017,24 +5963,15 @@ export declare const hazeTools: {
|
|
|
6017
5963
|
}, {
|
|
6018
5964
|
ok: boolean;
|
|
6019
5965
|
error: string;
|
|
6020
|
-
taskCount?: undefined;
|
|
6021
|
-
summary?: undefined;
|
|
6022
|
-
counts?: undefined;
|
|
6023
5966
|
} | {
|
|
6024
|
-
ok: boolean;
|
|
6025
|
-
taskCount: number;
|
|
6026
5967
|
summary: string;
|
|
6027
|
-
|
|
6028
|
-
counts?: undefined;
|
|
6029
|
-
} | {
|
|
6030
|
-
ok: boolean;
|
|
6031
|
-
taskCount: number;
|
|
6032
|
-
counts: {
|
|
5968
|
+
counts?: {
|
|
6033
5969
|
pending: number;
|
|
6034
5970
|
in_progress: number;
|
|
6035
5971
|
completed: number;
|
|
6036
|
-
};
|
|
6037
|
-
|
|
5972
|
+
} | undefined;
|
|
5973
|
+
ok: boolean;
|
|
5974
|
+
taskCount: number;
|
|
6038
5975
|
error?: undefined;
|
|
6039
5976
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
6040
5977
|
} & {
|
|
@@ -6066,24 +6003,15 @@ export declare const hazeTools: {
|
|
|
6066
6003
|
}, {
|
|
6067
6004
|
ok: boolean;
|
|
6068
6005
|
error: string;
|
|
6069
|
-
taskCount?: undefined;
|
|
6070
|
-
summary?: undefined;
|
|
6071
|
-
counts?: undefined;
|
|
6072
6006
|
} | {
|
|
6073
|
-
ok: boolean;
|
|
6074
|
-
taskCount: number;
|
|
6075
6007
|
summary: string;
|
|
6076
|
-
|
|
6077
|
-
counts?: undefined;
|
|
6078
|
-
} | {
|
|
6079
|
-
ok: boolean;
|
|
6080
|
-
taskCount: number;
|
|
6081
|
-
counts: {
|
|
6008
|
+
counts?: {
|
|
6082
6009
|
pending: number;
|
|
6083
6010
|
in_progress: number;
|
|
6084
6011
|
completed: number;
|
|
6085
|
-
};
|
|
6086
|
-
|
|
6012
|
+
} | undefined;
|
|
6013
|
+
ok: boolean;
|
|
6014
|
+
taskCount: number;
|
|
6087
6015
|
error?: undefined;
|
|
6088
6016
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
6089
6017
|
}) | ({
|
|
@@ -6126,24 +6054,15 @@ export declare const hazeTools: {
|
|
|
6126
6054
|
output: NoInfer<{
|
|
6127
6055
|
ok: boolean;
|
|
6128
6056
|
error: string;
|
|
6129
|
-
taskCount?: undefined;
|
|
6130
|
-
summary?: undefined;
|
|
6131
|
-
counts?: undefined;
|
|
6132
6057
|
} | {
|
|
6133
|
-
ok: boolean;
|
|
6134
|
-
taskCount: number;
|
|
6135
6058
|
summary: string;
|
|
6136
|
-
|
|
6137
|
-
counts?: undefined;
|
|
6138
|
-
} | {
|
|
6139
|
-
ok: boolean;
|
|
6140
|
-
taskCount: number;
|
|
6141
|
-
counts: {
|
|
6059
|
+
counts?: {
|
|
6142
6060
|
pending: number;
|
|
6143
6061
|
in_progress: number;
|
|
6144
6062
|
completed: number;
|
|
6145
|
-
};
|
|
6146
|
-
|
|
6063
|
+
} | undefined;
|
|
6064
|
+
ok: boolean;
|
|
6065
|
+
taskCount: number;
|
|
6147
6066
|
error?: undefined;
|
|
6148
6067
|
}>;
|
|
6149
6068
|
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
@@ -6151,24 +6070,15 @@ export declare const hazeTools: {
|
|
|
6151
6070
|
outputSchema?: import("ai").FlexibleSchema<{
|
|
6152
6071
|
ok: boolean;
|
|
6153
6072
|
error: string;
|
|
6154
|
-
taskCount?: undefined;
|
|
6155
|
-
summary?: undefined;
|
|
6156
|
-
counts?: undefined;
|
|
6157
6073
|
} | {
|
|
6158
|
-
ok: boolean;
|
|
6159
|
-
taskCount: number;
|
|
6160
6074
|
summary: string;
|
|
6161
|
-
|
|
6162
|
-
counts?: undefined;
|
|
6163
|
-
} | {
|
|
6164
|
-
ok: boolean;
|
|
6165
|
-
taskCount: number;
|
|
6166
|
-
counts: {
|
|
6075
|
+
counts?: {
|
|
6167
6076
|
pending: number;
|
|
6168
6077
|
in_progress: number;
|
|
6169
6078
|
completed: number;
|
|
6170
|
-
};
|
|
6171
|
-
|
|
6079
|
+
} | undefined;
|
|
6080
|
+
ok: boolean;
|
|
6081
|
+
taskCount: number;
|
|
6172
6082
|
error?: undefined;
|
|
6173
6083
|
}> | undefined;
|
|
6174
6084
|
execute: import("ai").ToolExecuteFunction<{
|
|
@@ -6179,24 +6089,15 @@ export declare const hazeTools: {
|
|
|
6179
6089
|
}, {
|
|
6180
6090
|
ok: boolean;
|
|
6181
6091
|
error: string;
|
|
6182
|
-
taskCount?: undefined;
|
|
6183
|
-
summary?: undefined;
|
|
6184
|
-
counts?: undefined;
|
|
6185
6092
|
} | {
|
|
6186
|
-
ok: boolean;
|
|
6187
|
-
taskCount: number;
|
|
6188
6093
|
summary: string;
|
|
6189
|
-
|
|
6190
|
-
counts?: undefined;
|
|
6191
|
-
} | {
|
|
6192
|
-
ok: boolean;
|
|
6193
|
-
taskCount: number;
|
|
6194
|
-
counts: {
|
|
6094
|
+
counts?: {
|
|
6195
6095
|
pending: number;
|
|
6196
6096
|
in_progress: number;
|
|
6197
6097
|
completed: number;
|
|
6198
|
-
};
|
|
6199
|
-
|
|
6098
|
+
} | undefined;
|
|
6099
|
+
ok: boolean;
|
|
6100
|
+
taskCount: number;
|
|
6200
6101
|
error?: undefined;
|
|
6201
6102
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
6202
6103
|
} & {
|
|
@@ -6218,24 +6119,15 @@ export declare const hazeTools: {
|
|
|
6218
6119
|
}, {
|
|
6219
6120
|
ok: boolean;
|
|
6220
6121
|
error: string;
|
|
6221
|
-
taskCount?: undefined;
|
|
6222
|
-
summary?: undefined;
|
|
6223
|
-
counts?: undefined;
|
|
6224
6122
|
} | {
|
|
6225
|
-
ok: boolean;
|
|
6226
|
-
taskCount: number;
|
|
6227
6123
|
summary: string;
|
|
6228
|
-
|
|
6229
|
-
counts?: undefined;
|
|
6230
|
-
} | {
|
|
6231
|
-
ok: boolean;
|
|
6232
|
-
taskCount: number;
|
|
6233
|
-
counts: {
|
|
6124
|
+
counts?: {
|
|
6234
6125
|
pending: number;
|
|
6235
6126
|
in_progress: number;
|
|
6236
6127
|
completed: number;
|
|
6237
|
-
};
|
|
6238
|
-
|
|
6128
|
+
} | undefined;
|
|
6129
|
+
ok: boolean;
|
|
6130
|
+
taskCount: number;
|
|
6239
6131
|
error?: undefined;
|
|
6240
6132
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
6241
6133
|
}) | ({
|
|
@@ -6278,24 +6170,15 @@ export declare const hazeTools: {
|
|
|
6278
6170
|
output: NoInfer<{
|
|
6279
6171
|
ok: boolean;
|
|
6280
6172
|
error: string;
|
|
6281
|
-
taskCount?: undefined;
|
|
6282
|
-
summary?: undefined;
|
|
6283
|
-
counts?: undefined;
|
|
6284
6173
|
} | {
|
|
6285
|
-
ok: boolean;
|
|
6286
|
-
taskCount: number;
|
|
6287
6174
|
summary: string;
|
|
6288
|
-
|
|
6289
|
-
counts?: undefined;
|
|
6290
|
-
} | {
|
|
6291
|
-
ok: boolean;
|
|
6292
|
-
taskCount: number;
|
|
6293
|
-
counts: {
|
|
6175
|
+
counts?: {
|
|
6294
6176
|
pending: number;
|
|
6295
6177
|
in_progress: number;
|
|
6296
6178
|
completed: number;
|
|
6297
|
-
};
|
|
6298
|
-
|
|
6179
|
+
} | undefined;
|
|
6180
|
+
ok: boolean;
|
|
6181
|
+
taskCount: number;
|
|
6299
6182
|
error?: undefined;
|
|
6300
6183
|
}>;
|
|
6301
6184
|
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
@@ -6303,24 +6186,15 @@ export declare const hazeTools: {
|
|
|
6303
6186
|
outputSchema?: import("ai").FlexibleSchema<{
|
|
6304
6187
|
ok: boolean;
|
|
6305
6188
|
error: string;
|
|
6306
|
-
taskCount?: undefined;
|
|
6307
|
-
summary?: undefined;
|
|
6308
|
-
counts?: undefined;
|
|
6309
6189
|
} | {
|
|
6310
|
-
ok: boolean;
|
|
6311
|
-
taskCount: number;
|
|
6312
6190
|
summary: string;
|
|
6313
|
-
|
|
6314
|
-
counts?: undefined;
|
|
6315
|
-
} | {
|
|
6316
|
-
ok: boolean;
|
|
6317
|
-
taskCount: number;
|
|
6318
|
-
counts: {
|
|
6191
|
+
counts?: {
|
|
6319
6192
|
pending: number;
|
|
6320
6193
|
in_progress: number;
|
|
6321
6194
|
completed: number;
|
|
6322
|
-
};
|
|
6323
|
-
|
|
6195
|
+
} | undefined;
|
|
6196
|
+
ok: boolean;
|
|
6197
|
+
taskCount: number;
|
|
6324
6198
|
error?: undefined;
|
|
6325
6199
|
}> | undefined;
|
|
6326
6200
|
execute: import("ai").ToolExecuteFunction<{
|
|
@@ -6331,24 +6205,15 @@ export declare const hazeTools: {
|
|
|
6331
6205
|
}, {
|
|
6332
6206
|
ok: boolean;
|
|
6333
6207
|
error: string;
|
|
6334
|
-
taskCount?: undefined;
|
|
6335
|
-
summary?: undefined;
|
|
6336
|
-
counts?: undefined;
|
|
6337
6208
|
} | {
|
|
6338
|
-
ok: boolean;
|
|
6339
|
-
taskCount: number;
|
|
6340
6209
|
summary: string;
|
|
6341
|
-
|
|
6342
|
-
counts?: undefined;
|
|
6343
|
-
} | {
|
|
6344
|
-
ok: boolean;
|
|
6345
|
-
taskCount: number;
|
|
6346
|
-
counts: {
|
|
6210
|
+
counts?: {
|
|
6347
6211
|
pending: number;
|
|
6348
6212
|
in_progress: number;
|
|
6349
6213
|
completed: number;
|
|
6350
|
-
};
|
|
6351
|
-
|
|
6214
|
+
} | undefined;
|
|
6215
|
+
ok: boolean;
|
|
6216
|
+
taskCount: number;
|
|
6352
6217
|
error?: undefined;
|
|
6353
6218
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
6354
6219
|
} & {
|
|
@@ -6370,24 +6235,15 @@ export declare const hazeTools: {
|
|
|
6370
6235
|
}, {
|
|
6371
6236
|
ok: boolean;
|
|
6372
6237
|
error: string;
|
|
6373
|
-
taskCount?: undefined;
|
|
6374
|
-
summary?: undefined;
|
|
6375
|
-
counts?: undefined;
|
|
6376
6238
|
} | {
|
|
6377
|
-
ok: boolean;
|
|
6378
|
-
taskCount: number;
|
|
6379
6239
|
summary: string;
|
|
6380
|
-
|
|
6381
|
-
counts?: undefined;
|
|
6382
|
-
} | {
|
|
6383
|
-
ok: boolean;
|
|
6384
|
-
taskCount: number;
|
|
6385
|
-
counts: {
|
|
6240
|
+
counts?: {
|
|
6386
6241
|
pending: number;
|
|
6387
6242
|
in_progress: number;
|
|
6388
6243
|
completed: number;
|
|
6389
|
-
};
|
|
6390
|
-
|
|
6244
|
+
} | undefined;
|
|
6245
|
+
ok: boolean;
|
|
6246
|
+
taskCount: number;
|
|
6391
6247
|
error?: undefined;
|
|
6392
6248
|
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
6393
6249
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tool } from 'ai';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { classifyShellCommand, isValidationClassification } from '../../core/safety/shellClassifier.js';
|
|
3
|
+
import { classifyShellCommand, commandMasksValidationExit, isValidationClassification } from '../../core/safety/shellClassifier.js';
|
|
4
4
|
import { detectMissingExecutable, missingExecutableFields } from '../../core/safety/missingExecutable.js';
|
|
5
5
|
import { parseValidationOutput } from '../../core/validation/outputParser.js';
|
|
6
6
|
import { filterShellOutput } from '../../core/shellOutput/registry.js';
|
|
@@ -11,7 +11,7 @@ import { hazeContext, hazeToolContextSchema, runDedupedTool } from './toolContex
|
|
|
11
11
|
import { runBoundedProcess } from '../../core/process/runBoundedProcess.js';
|
|
12
12
|
import { SHELL_STREAM_BYTES, SHORT_VALIDATION_CHARS } from '../../core/limits.js';
|
|
13
13
|
import { startBackgroundProcess } from '../../core/process/backgroundRegistry.js';
|
|
14
|
-
import { resolveUserShell, shellInvocation, shellSyntaxGuidance } from '../../core/process/userShell.js';
|
|
14
|
+
import { resolveUserShell, shellDialect, shellInvocation, shellSyntaxGuidance } from '../../core/process/userShell.js';
|
|
15
15
|
/** Byte-stat metadata only — the raw stream text must never reach the model context (see code-review CR-001). */
|
|
16
16
|
function streamByteStats(stream) {
|
|
17
17
|
return { totalBytes: stream.totalBytes, retainedBytes: stream.retainedBytes, omittedBytes: stream.omittedBytes };
|
|
@@ -22,7 +22,7 @@ export const shellTool = tool({
|
|
|
22
22
|
contextSchema: hazeToolContextSchema,
|
|
23
23
|
inputSchema: z.object({
|
|
24
24
|
command: z.string().min(1).describe(`Command to execute with ${userShell} ${shellInvocation('', userShell).args.join(' ')}. ${shellSyntaxGuidance(userShell)}`.trim()),
|
|
25
|
-
purpose: z.enum(['auto', 'validation']).default('auto').describe('Use validation for an intentional test/check command,
|
|
25
|
+
purpose: z.enum(['auto', 'validation']).default('auto').describe('Use validation for an intentional test/check command; known test/build commands are the authoritative completion evidence, custom checks supplement them. Pass/fail comes from the real process result.'),
|
|
26
26
|
timeoutSeconds: z.number().int().positive().max(600).optional().describe('Timeout in seconds; defaults to 60'),
|
|
27
27
|
background: z.boolean().default(false).describe('Start a registered long-running process and return immediately. Use process to list, inspect output, or kill it.'),
|
|
28
28
|
}),
|
|
@@ -49,15 +49,34 @@ export const shellTool = tool({
|
|
|
49
49
|
}
|
|
50
50
|
const timeoutMs = (timeoutSeconds ?? 60) * 1000;
|
|
51
51
|
const startedAt = Date.now();
|
|
52
|
-
|
|
52
|
+
// Validation exit codes must be truthful evidence: a pipeline like
|
|
53
|
+
// `npm test | tail` otherwise reports the final stage's success while the
|
|
54
|
+
// suite failed (found by the honest-impossibility eval). `pipefail` makes
|
|
55
|
+
// any failing stage fail the pipeline; shells without it degrade to their
|
|
56
|
+
// default pipeline semantics through the guarded `set` (POSIX shells only).
|
|
57
|
+
const isValidationCommand = purpose === 'validation' || isValidationClassification(classification);
|
|
58
|
+
const executionCommand = isValidationCommand && shellDialect(userShell) === 'posix' ? `set -o pipefail 2>/dev/null || true; ${command}` : command;
|
|
59
|
+
const processResult = await runBoundedProcess({ ...shellInvocation(executionCommand), cwd, timeoutMs, signal: context.abortSignal, maxStdoutBytes: SHELL_STREAM_BYTES, maxStderrBytes: SHELL_STREAM_BYTES });
|
|
53
60
|
const { code, timedOut } = processResult;
|
|
54
61
|
const stdout = processResult.stdout.text;
|
|
55
62
|
const stderr = processResult.stderr.text;
|
|
56
|
-
const validationSummary =
|
|
63
|
+
const validationSummary = isValidationCommand
|
|
57
64
|
? parseValidationOutput({ command, code, stdout, stderr, timedOut, stdoutTruncated: processResult.stdout.omittedBytes > 0, stderrTruncated: processResult.stderr.omittedBytes > 0, classification })
|
|
58
65
|
: undefined;
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
// Evidence truthfulness: a passing validation whose command shape can
|
|
67
|
+
// mask an earlier failing stage (`npm test > out; cat out` ends with the
|
|
68
|
+
// last stage's status) is demoted to unconfirmed — generic kind — so the
|
|
69
|
+
// completion gate cannot treat it as authoritative (found by the
|
|
70
|
+
// honest-impossibility eval). Failing validations keep their kind: a
|
|
71
|
+
// masked compound that still failed is honestly failed.
|
|
72
|
+
const authoritative = validationSummary == null || validationSummary.status !== 'passed' || !commandMasksValidationExit(command);
|
|
73
|
+
const confirmedValidationSummary = validationSummary && authoritative
|
|
74
|
+
? validationSummary
|
|
75
|
+
: validationSummary
|
|
76
|
+
? { ...validationSummary, kind: 'generic', summaryText: `${validationSummary.summaryText ?? ''} (compound command: exit-code provenance unconfirmed)`.trim() }
|
|
77
|
+
: undefined;
|
|
78
|
+
const validationPassed = confirmedValidationSummary?.status === 'passed';
|
|
79
|
+
const output = filterShellOutput({ command, code, stdout, stderr, timedOut, classification, validationSummary: confirmedValidationSummary, storeRawOutput: storeToolOutput, fallbackCompact: compactStoredOutput, compactMaxChars: validationPassed ? SHORT_VALIDATION_CHARS : COMPACT_COMMAND_CHARS });
|
|
61
80
|
// Generic, dependency-agnostic diagnostic for a missing executable. Only the
|
|
62
81
|
// executable name and a generic next step are exposed (never raw stderr).
|
|
63
82
|
const missing = code !== 0 && !processResult.aborted ? detectMissingExecutable({ command, code, stderr }) : undefined;
|
|
@@ -65,7 +84,7 @@ export const shellTool = tool({
|
|
|
65
84
|
ok: code === 0 && !timedOut && !processResult.aborted && !processResult.error,
|
|
66
85
|
code, command, purpose, cwd, classification, durationMs: Date.now() - startedAt, timedOut,
|
|
67
86
|
aborted: processResult.aborted, signal: processResult.signal, forcedTermination: processResult.forced,
|
|
68
|
-
stdout: output.stdout, stderr: output.stderr, validationSummary,
|
|
87
|
+
stdout: output.stdout, stderr: output.stderr, validationSummary: confirmedValidationSummary,
|
|
69
88
|
stdoutBytes: streamByteStats(processResult.stdout), stderrBytes: streamByteStats(processResult.stderr),
|
|
70
89
|
...(missing ? { ...missingExecutableFields(missing), missingExecutableStep: missing.suggestedNextStep } : {}),
|
|
71
90
|
...(processResult.error ? { error: processResult.error } : {}),
|