anymous 1.2.0 → 1.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymous",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "AI-powered reverse engineering platform",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -171,7 +171,7 @@ function draw(
171
171
  }
172
172
  }
173
173
 
174
- const VERSION = "1.2.0"
174
+ const VERSION = "1.2.1"
175
175
 
176
176
  function build(input: SplashWriterInput, kind: "entry" | "exit", ctx: ScrollbackRenderContext): ScrollbackSnapshot {
177
177
  const width = Math.max(1, ctx.width)
package/src/cli/ui.ts CHANGED
@@ -54,7 +54,7 @@ export function logo(pad?: string) {
54
54
  result.push(row)
55
55
  result.push(EOL)
56
56
  }
57
- result.push("AI-Powered Reverse Engineering & Pentest Platform v1.2.0")
57
+ result.push("AI-Powered Reverse Engineering & Pentest Platform v1.2.1")
58
58
  return result.join("")
59
59
  }
60
60
 
@@ -103,7 +103,7 @@ export function logo(pad?: string) {
103
103
  result.push(EOL)
104
104
  })
105
105
  result.push(Style.TEXT_NORMAL, "─".repeat(45), EOL)
106
- result.push(Style.TEXT_INFO, "▸", Style.TEXT_NORMAL, " AI-Powered Reverse Engineering & Pentest Platform ", Style.TEXT_DIM, "v1.2.0", EOL)
106
+ result.push(Style.TEXT_INFO, "▸", Style.TEXT_NORMAL, " AI-Powered Reverse Engineering & Pentest Platform ", Style.TEXT_DIM, "v1.2.1", EOL)
107
107
  result.push(Style.TEXT_NORMAL, "─".repeat(45))
108
108
  return result.join("").trimEnd()
109
109
  }
@@ -1,6 +1,6 @@
1
1
  import { Effect, Schema, pipe } from "effect"
2
2
  import * as Tool from "./tool"
3
- import { spawn } from "child_process"
3
+ import { spawn, execSync } from "child_process"
4
4
  import DESCRIPTION from "./computer.txt"
5
5
 
6
6
  const platform = process.platform
@@ -142,32 +142,55 @@ Add-Type -AssemblyName System.Windows.Forms
142
142
  }
143
143
  })
144
144
 
145
- const typeText = Effect.fn("Computer.typeText")(function* (text: string) {
146
- if (platform === "win32") {
147
- const escaped = text.replace(/"/g, '`"').replace(/\$/g, "`$").replace(/\n/g, "`n").replace(/\r/g, "`r").replace(/\t/g, "`t")
148
- yield* poweshellScript(`
149
- Add-Type -AssemblyName System.Windows.Forms
150
- [System.Windows.Forms.SendKeys]::SendWait("${escaped}")
151
- `)
152
- } else if (platform === "darwin") {
153
- yield* Effect.promise(() =>
154
- new Promise<void>((resolve, reject) => {
155
- const proc = spawn("osascript", [
156
- "-e",
157
- `tell application "System Events" to keystroke "${text.replace(/"/g, '\\"')}"`,
158
- ])
159
- proc.on("close", (code) => (code === 0 ? resolve() : reject(new Error(`exit ${code}`))))
160
- proc.on("error", reject)
161
- }),
162
- )
163
- } else if (platform === "linux") {
164
- yield* Effect.promise(() =>
165
- new Promise<void>((resolve, reject) => {
166
- const proc = spawn("xdotool", ["type", text])
167
- proc.on("close", (code) => (code === 0 ? resolve() : reject(new Error(`exit ${code}`))))
168
- proc.on("error", reject)
169
- }),
170
- )
145
+ const typeText = Effect.fn("Computer.typeText")(function* (text: string, delayMs: number = 0) {
146
+ const typeChar = (char: string) => {
147
+ if (platform === "win32") {
148
+ const esc = char.replace(/"/g, '`"').replace(/\$/g, "`$")
149
+ return poweshellScript(`Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SendKeys]::SendWait("${esc}")`)
150
+ } else if (platform === "darwin") {
151
+ return Effect.promise<void>(() =>
152
+ new Promise((resolve, reject) => {
153
+ const proc = spawn("osascript", ["-e", `tell application "System Events" to keystroke "${char.replace(/"/g, '\\"')}"`])
154
+ proc.on("close", (code) => (code === 0 ? resolve() : reject(new Error(`exit ${code}`))))
155
+ proc.on("error", reject)
156
+ }),
157
+ )
158
+ } else {
159
+ return Effect.promise<void>(() =>
160
+ new Promise((resolve, reject) => {
161
+ const proc = spawn("xdotool", ["type", char])
162
+ proc.on("close", (code) => (code === 0 ? resolve() : reject(new Error(`exit ${code}`))))
163
+ proc.on("error", reject)
164
+ }),
165
+ )
166
+ }
167
+ }
168
+ if (delayMs <= 0) {
169
+ if (platform === "win32") {
170
+ const escaped = text.replace(/"/g, '`"').replace(/\$/g, "`$").replace(/\n/g, "`n").replace(/\r/g, "`r").replace(/\t/g, "`t")
171
+ yield* poweshellScript(`Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SendKeys]::SendWait("${escaped}")`)
172
+ } else if (platform === "darwin") {
173
+ yield* Effect.promise<void>(() =>
174
+ new Promise((resolve, reject) => {
175
+ const proc = spawn("osascript", ["-e", `tell application "System Events" to keystroke "${text.replace(/"/g, '\\"')}"`])
176
+ proc.on("close", (code) => (code === 0 ? resolve() : reject(new Error(`exit ${code}`))))
177
+ proc.on("error", reject)
178
+ }),
179
+ )
180
+ } else {
181
+ yield* Effect.promise<void>(() =>
182
+ new Promise((resolve, reject) => {
183
+ const proc = spawn("xdotool", ["type", text])
184
+ proc.on("close", (code) => (code === 0 ? resolve() : reject(new Error(`exit ${code}`))))
185
+ proc.on("error", reject)
186
+ }),
187
+ )
188
+ }
189
+ } else {
190
+ for (const char of text) {
191
+ yield* typeChar(char)
192
+ if (delayMs > 0) yield* Effect.promise<void>((resolve) => setTimeout(resolve, delayMs))
193
+ }
171
194
  }
172
195
  })
173
196
 
@@ -291,6 +314,7 @@ export const Action = Schema.Struct({
291
314
  x: Schema.optional(Schema.Number).annotate({ description: "X coordinate for click/move actions" }),
292
315
  y: Schema.optional(Schema.Number).annotate({ description: "Y coordinate for click/move actions" }),
293
316
  text: Schema.optional(Schema.String).annotate({ description: "Text to type (for type action)" }),
317
+ delayMs: Schema.optional(Schema.Number).annotate({ description: "Delay in ms between keystrokes (for type action, default: 0)" }),
294
318
  keys: Schema.optional(Schema.Array(Schema.String)).annotate({ description: "Keys to press (for keypress action), e.g. ['ctrl', 'c']" }),
295
319
  button: Schema.optional(Schema.Literal("left", "right", "middle")).annotate({ description: "Mouse button (default: left)" }),
296
320
  clicks: Schema.optional(Schema.Number).annotate({ description: "Scroll clicks (positive=up, negative=down)" }),
@@ -350,7 +374,7 @@ export const ComputerTool = Tool.define<typeof Action, {}, Question.Service>(
350
374
  }
351
375
 
352
376
  if (action === "type") {
353
- yield* typeText(params.text!)
377
+ yield* typeText(params.text!, params.delayMs ?? 0)
354
378
  const dataUrl = yield* captureScreenshot
355
379
  return {
356
380
  title: `Typed text`,
@@ -6,11 +6,13 @@ Available actions:
6
6
  - click (x?, y?, button?): Click at position (default: left button)
7
7
  - doubleclick (x?, y?): Double-click at position
8
8
  - rightclick (x?, y?): Right-click at position
9
- - type (text): Type text at current cursor position
10
- - keypress (keys): Press key combination (e.g. ["ctrl", "c"], ["alt", "tab"], ["enter"])
9
+ - type (text, delayMs?): Type text at current cursor position. Use delayMs (ms) to add a pause between each keystroke — useful for visible/animating typing effects or to let UI elements load between chars.
10
+ - keypress (keys): Press key combination (e.g. ["ctrl", "c"], ["alt", "tab"], ["enter"]). Common shortcuts: ^l = address bar focus (Ctrl+L), ^a = select all, ^c = copy, ^v = paste, ^s = save
11
11
  - scroll (clicks): Scroll up (positive) or down (negative)
12
12
  - screensize: Get screen dimensions
13
13
 
14
+ Tip: To open a URL, first use keypress with ["ctrl", "l"] to focus the address bar, then type the URL, then press enter.
15
+
14
16
  Coordinate system: (0,0) is top-left corner of primary screen. Get screen dimensions via screensize action.
15
17
 
16
18
  Platform support: Windows (native), macOS (via screencapture + osascript), Linux (via ImageMagick + xdotool).