@iinm/plain-agent 1.8.3 → 1.8.4

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.
Files changed (86) hide show
  1. package/README.md +2 -2
  2. package/bin/plain +1 -1
  3. package/config/config.predefined.json +1 -1
  4. package/config/prompts.predefined/shortcuts/configure.md +1 -1
  5. package/dist/main.mjs +473 -0
  6. package/dist/main.mjs.map +7 -0
  7. package/package.json +5 -7
  8. package/src/agent.d.ts +0 -52
  9. package/src/agent.mjs +0 -204
  10. package/src/agentLoop.mjs +0 -419
  11. package/src/agentState.mjs +0 -41
  12. package/src/claudeCodePlugin.mjs +0 -164
  13. package/src/cliArgs.mjs +0 -175
  14. package/src/cliBatch.mjs +0 -147
  15. package/src/cliCommands.mjs +0 -283
  16. package/src/cliCompleter.mjs +0 -227
  17. package/src/cliCost.mjs +0 -309
  18. package/src/cliFormatter.mjs +0 -413
  19. package/src/cliInteractive.mjs +0 -529
  20. package/src/cliInterruptTransform.mjs +0 -51
  21. package/src/cliMuteTransform.mjs +0 -26
  22. package/src/cliPasteTransform.mjs +0 -183
  23. package/src/config.d.ts +0 -36
  24. package/src/config.mjs +0 -197
  25. package/src/context/loadAgentRoles.mjs +0 -283
  26. package/src/context/loadPrompts.mjs +0 -324
  27. package/src/context/loadUserMessageContext.mjs +0 -147
  28. package/src/costTracker.mjs +0 -210
  29. package/src/env.mjs +0 -44
  30. package/src/main.mjs +0 -279
  31. package/src/mcpClient.mjs +0 -351
  32. package/src/mcpIntegration.mjs +0 -160
  33. package/src/model.d.ts +0 -109
  34. package/src/modelCaller.mjs +0 -32
  35. package/src/modelDefinition.d.ts +0 -92
  36. package/src/prompt.mjs +0 -138
  37. package/src/providers/anthropic.d.ts +0 -248
  38. package/src/providers/anthropic.mjs +0 -587
  39. package/src/providers/bedrock.d.ts +0 -249
  40. package/src/providers/bedrock.mjs +0 -700
  41. package/src/providers/gemini.d.ts +0 -208
  42. package/src/providers/gemini.mjs +0 -754
  43. package/src/providers/openai.d.ts +0 -281
  44. package/src/providers/openai.mjs +0 -544
  45. package/src/providers/openaiCompatible.d.ts +0 -147
  46. package/src/providers/openaiCompatible.mjs +0 -652
  47. package/src/providers/platform/awsSigV4.mjs +0 -184
  48. package/src/providers/platform/azure.mjs +0 -42
  49. package/src/providers/platform/bedrock.mjs +0 -78
  50. package/src/providers/platform/googleCloud.mjs +0 -34
  51. package/src/subagent.mjs +0 -265
  52. package/src/tmpfile.mjs +0 -27
  53. package/src/tool.d.ts +0 -74
  54. package/src/toolExecutor.mjs +0 -236
  55. package/src/toolInputValidator.mjs +0 -183
  56. package/src/toolUseApprover.mjs +0 -99
  57. package/src/tools/askURL.mjs +0 -209
  58. package/src/tools/askWeb.mjs +0 -208
  59. package/src/tools/compactContext.d.ts +0 -4
  60. package/src/tools/compactContext.mjs +0 -87
  61. package/src/tools/delegateToSubagent.d.ts +0 -4
  62. package/src/tools/delegateToSubagent.mjs +0 -48
  63. package/src/tools/execCommand.d.ts +0 -22
  64. package/src/tools/execCommand.mjs +0 -200
  65. package/src/tools/patchFile.d.ts +0 -4
  66. package/src/tools/patchFile.mjs +0 -133
  67. package/src/tools/reportAsSubagent.d.ts +0 -3
  68. package/src/tools/reportAsSubagent.mjs +0 -44
  69. package/src/tools/tmuxCommand.d.ts +0 -14
  70. package/src/tools/tmuxCommand.mjs +0 -194
  71. package/src/tools/writeFile.d.ts +0 -4
  72. package/src/tools/writeFile.mjs +0 -56
  73. package/src/usageStore.mjs +0 -167
  74. package/src/utils/evalJSONConfig.mjs +0 -72
  75. package/src/utils/matchValue.d.ts +0 -6
  76. package/src/utils/matchValue.mjs +0 -40
  77. package/src/utils/noThrow.mjs +0 -31
  78. package/src/utils/notify.mjs +0 -29
  79. package/src/utils/parseFileRange.mjs +0 -18
  80. package/src/utils/readFileRange.mjs +0 -33
  81. package/src/utils/retryOnError.mjs +0 -41
  82. package/src/voiceInput.mjs +0 -61
  83. package/src/voiceInputGemini.mjs +0 -105
  84. package/src/voiceInputOpenAI.mjs +0 -104
  85. package/src/voiceInputSession.mjs +0 -543
  86. package/src/voiceToggleKey.mjs +0 -62
@@ -1,208 +0,0 @@
1
- /* Model */
2
- export type GeminiModelConfig = {
3
- // https://ai.google.dev/gemini-api/docs/models
4
- model: string;
5
- requestConfig?: {
6
- generationConfig: GeminiGenerationConfig;
7
- safetySettings?: GeminiSafetySetting[];
8
- };
9
- };
10
-
11
- // https://ai.google.dev/api/generate-content
12
- export type GeminiGenerationConfig = {
13
- /**
14
- * If less than 1, it tends to cause loops in Gemini 3.
15
- * https://ai.google.dev/gemini-api/docs/troubleshooting?hl=ja#repetitive-tokens
16
- */
17
- temperature?: number;
18
- maxOutputTokens?: number;
19
- thinkingConfig?: {
20
- includeThoughts: boolean;
21
- } & (
22
- | {
23
- thinkingBudget?: number;
24
- }
25
- | {
26
- thinkingLevel?: "low" | "medium" | "high";
27
- }
28
- );
29
- };
30
-
31
- export type GeminiSafetySetting = {
32
- /**
33
- * - HARM_CATEGORY_SEXUALLY_EXPLICIT
34
- * - HARM_CATEGORY_HATE_SPEECH
35
- * - HARM_CATEGORY_HARASSMENT
36
- * - HARM_CATEGORY_DANGEROUS_CONTENT
37
- */
38
- category: string;
39
-
40
- /**
41
- * - BLOCK_NONE
42
- * ...
43
- */
44
- threshold: string;
45
- };
46
-
47
- /* Input */
48
- export type GeminiGenerateContentInput = {
49
- generationConfig: GeminiGenerationConfig;
50
- safetySettings: GeminiSafetySetting[];
51
- system_instruction?: {
52
- parts: GeminiContentPartText[];
53
- };
54
- cachedContent?: string;
55
- contents: (GeminiUserContent | GeminiModelContent | GeminiFunctionContent)[];
56
- tools?: GeminiToolDefinition[];
57
- toolConfig?: GeminiToolConfig;
58
- };
59
-
60
- /* Content */
61
- export type GeminiContent =
62
- | GeminiSystemContent
63
- | GeminiModelContent
64
- | GeminiUserContent
65
- | GeminiFunctionContent;
66
-
67
- export type GeminiSystemContent = {
68
- role: "system";
69
- parts: GeminiContentPartText[];
70
- };
71
-
72
- export type GeminiModelContent = {
73
- role: "model";
74
- parts?: (GeminiContentPartText | GeminiContentPartFunctionCall)[];
75
- };
76
-
77
- export type GeminiUserContent = {
78
- role: "user";
79
- parts: (GeminiContentPartText | GeminiContentPartInlineData)[];
80
- };
81
-
82
- export type GeminiFunctionContent = {
83
- role: "user";
84
- parts: GeminiContentPartFunctionResponse[];
85
- };
86
-
87
- /* Content Parts */
88
- export type GeminiContentPartText = {
89
- text: string;
90
- thoughtSignature?: string;
91
- thought?: boolean;
92
- };
93
-
94
- export type GeminiContentPartFunctionCall = {
95
- functionCall: {
96
- name: string;
97
- args: Record<string, unknown>;
98
- };
99
- thoughtSignature?: string;
100
- };
101
-
102
- export type GeminiContentPartFunctionResponse = {
103
- functionResponse: {
104
- name: string;
105
- response: {
106
- name: string;
107
- content: (GeminiContentPartText | GeminiContentPartInlineData)[];
108
- };
109
- };
110
- };
111
-
112
- export type GeminiContentPartInlineData = {
113
- inline_data: {
114
- mime_type: string;
115
- data: string;
116
- };
117
- };
118
-
119
- /**
120
- * Tool
121
- * ref. https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1beta1/FunctionDeclaration
122
- */
123
- export type GeminiToolDefinition = {
124
- functionDeclarations: {
125
- name: string;
126
- description: string;
127
- parametersJsonSchema: Record<string, unknown>;
128
- }[];
129
- };
130
-
131
- export type GeminiToolConfig = {
132
- functionCallingConfig?: {
133
- mode?: "AUTO" | "ANY" | "NONE" | "VALIDATED";
134
- };
135
- };
136
-
137
- /* Output */
138
- export type GeminiGeneratedContent = {
139
- candidates?: GeminiGeneratedContentCandidate[];
140
- usageMetadata: GeminiUsageMetadata;
141
- modelVersion: string;
142
- };
143
-
144
- export type GeminiGeneratedContentCandidate = {
145
- content: GeminiModelContent;
146
- /**
147
- * - STOP
148
- * ...
149
- */
150
- finishReason?: "MALFORMED_FUNCTION_CALL" | string;
151
- finishMessage?: string;
152
- safetyRatings?: GeminiSafetyRating[];
153
- };
154
-
155
- export type GeminiSafetyRating = {
156
- category: string;
157
- probability: string;
158
- };
159
-
160
- export type GeminiTokensDetail = {
161
- /**
162
- * - TEXT
163
- */
164
- modality: string;
165
- tokenCount: number;
166
- };
167
-
168
- export type GeminiUsageMetadata = {
169
- totalTokenCount: number;
170
- promptTokenCount: number;
171
- cachedContentTokenCount?: number;
172
- candidatesTokenCount?: number;
173
- thoughtsTokenCount?: number;
174
- promptTokensDetails: GeminiTokensDetail[];
175
- cachedTokenDetails?: GeminiTokensDetail[];
176
- };
177
-
178
- /* Caching */
179
- export type GeminiCreateCachedContentInput = {
180
- model: string;
181
-
182
- /**
183
- * e.g., 600s
184
- */
185
- ttl: string;
186
-
187
- system_instruction?: {
188
- parts: GeminiContentPartText[];
189
- };
190
- contents: (GeminiUserContent | GeminiModelContent | GeminiFunctionContent)[];
191
- tools?: GeminiToolDefinition[];
192
- toolConfig?: GeminiToolConfig;
193
- };
194
-
195
- export type GeminiCachedContents = {
196
- contents: unknown[];
197
- tools: unknown[];
198
- createTime: string;
199
- updateTime: string;
200
- usageMetadata: GeminiUsageMetadata;
201
- expireTime: string;
202
- ttl: string;
203
- name: string;
204
- displayName: string;
205
- model: string;
206
- systemInstruction: unknown;
207
- toolConfig: unknown;
208
- };