@aiscene/core 8.0.6 → 8.0.8

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 (71) hide show
  1. package/dist/es/agent/utils.mjs +1 -1
  2. package/dist/es/index.mjs.map +1 -1
  3. package/dist/es/skill/index.mjs.map +1 -1
  4. package/dist/es/utils.mjs +2 -2
  5. package/dist/lib/agent/utils.js +1 -1
  6. package/dist/lib/index.js.map +1 -1
  7. package/dist/lib/skill/index.js.map +1 -1
  8. package/dist/lib/types.js +2 -2
  9. package/dist/lib/utils.js +2 -2
  10. package/dist/types/agent/agent.d.ts +216 -0
  11. package/dist/types/agent/common.d.ts +0 -0
  12. package/dist/types/agent/execution-session.d.ts +36 -0
  13. package/dist/types/agent/index.d.ts +9 -0
  14. package/dist/types/agent/task-builder.d.ts +34 -0
  15. package/dist/types/agent/task-cache.d.ts +49 -0
  16. package/dist/types/agent/tasks.d.ts +69 -0
  17. package/dist/types/agent/ui-utils.d.ts +14 -0
  18. package/dist/types/agent/utils.d.ts +25 -0
  19. package/dist/types/ai-model/auto-glm/actions.d.ts +78 -0
  20. package/dist/types/ai-model/auto-glm/index.d.ts +6 -0
  21. package/dist/types/ai-model/auto-glm/parser.d.ts +18 -0
  22. package/dist/types/ai-model/auto-glm/planning.d.ts +12 -0
  23. package/dist/types/ai-model/auto-glm/prompt.d.ts +27 -0
  24. package/dist/types/ai-model/auto-glm/util.d.ts +13 -0
  25. package/dist/types/ai-model/connectivity.d.ts +20 -0
  26. package/dist/types/ai-model/conversation-history.d.ts +105 -0
  27. package/dist/types/ai-model/index.d.ts +16 -0
  28. package/dist/types/ai-model/inspect.d.ts +67 -0
  29. package/dist/types/ai-model/llm-planning.d.ts +19 -0
  30. package/dist/types/ai-model/prompt/common.d.ts +2 -0
  31. package/dist/types/ai-model/prompt/describe.d.ts +1 -0
  32. package/dist/types/ai-model/prompt/extraction.d.ts +7 -0
  33. package/dist/types/ai-model/prompt/llm-locator.d.ts +3 -0
  34. package/dist/types/ai-model/prompt/llm-planning.d.ts +10 -0
  35. package/dist/types/ai-model/prompt/llm-section-locator.d.ts +3 -0
  36. package/dist/types/ai-model/prompt/order-sensitive-judge.d.ts +2 -0
  37. package/dist/types/ai-model/prompt/playwright-generator.d.ts +26 -0
  38. package/dist/types/ai-model/prompt/ui-tars-planning.d.ts +2 -0
  39. package/dist/types/ai-model/prompt/util.d.ts +33 -0
  40. package/dist/types/ai-model/prompt/yaml-generator.d.ts +102 -0
  41. package/dist/types/ai-model/service-caller/codex-app-server.d.ts +42 -0
  42. package/dist/types/ai-model/service-caller/image-detail.d.ts +2 -0
  43. package/dist/types/ai-model/service-caller/index.d.ts +49 -0
  44. package/dist/types/ai-model/ui-tars-planning.d.ts +72 -0
  45. package/dist/types/common.d.ts +288 -0
  46. package/dist/types/device/device-options.d.ts +145 -0
  47. package/dist/types/device/index.d.ts +2528 -0
  48. package/dist/types/dump/html-utils.d.ts +75 -0
  49. package/dist/types/dump/index.d.ts +5 -0
  50. package/dist/types/dump/screenshot-restoration.d.ts +8 -0
  51. package/dist/types/dump/screenshot-store.d.ts +49 -0
  52. package/dist/types/index.d.ts +22 -0
  53. package/dist/types/report-cli.d.ts +36 -0
  54. package/dist/types/report-generator.d.ts +81 -0
  55. package/dist/types/report-markdown.d.ts +24 -0
  56. package/dist/types/report.d.ts +52 -0
  57. package/dist/types/screenshot-item.d.ts +67 -0
  58. package/dist/types/service/index.d.ts +24 -0
  59. package/dist/types/service/utils.d.ts +2 -0
  60. package/dist/types/skill/index.d.ts +25 -0
  61. package/dist/types/task-runner.d.ts +50 -0
  62. package/dist/types/task-timing.d.ts +8 -0
  63. package/dist/types/tree.d.ts +4 -0
  64. package/dist/types/types.d.ts +681 -0
  65. package/dist/types/utils.d.ts +45 -0
  66. package/dist/types/yaml/builder.d.ts +2 -0
  67. package/dist/types/yaml/index.d.ts +4 -0
  68. package/dist/types/yaml/player.d.ts +34 -0
  69. package/dist/types/yaml/utils.d.ts +9 -0
  70. package/dist/types/yaml.d.ts +215 -0
  71. package/package.json +1 -1
@@ -140,7 +140,7 @@ async function matchElementFromCache(context, cacheEntry, cachePrompt, cacheable
140
140
  return;
141
141
  }
142
142
  }
143
- const getMidsceneVersion = ()=>"8.0.6";
143
+ const getMidsceneVersion = ()=>"8.0.8";
144
144
  const parsePrompt = (prompt)=>{
145
145
  if ('string' == typeof prompt) return {
146
146
  textPrompt: prompt,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { z } from 'zod';\nimport Service from './service/index';\nimport { TaskRunner } from './task-runner';\nimport { getVersion } from './utils';\n\nexport {\n plan,\n AiLocateElement,\n runConnectivityTest,\n getMidsceneLocationSchema,\n PointSchema,\n SizeSchema,\n RectSchema,\n TMultimodalPromptSchema,\n TUserPromptSchema,\n type TMultimodalPrompt,\n type TUserPrompt,\n type ConnectivityCheckResultItem,\n type ConnectivityTestConfig,\n type ConnectivityTestResult,\n} from './ai-model/index';\n\nexport {\n MIDSCENE_MODEL_NAME,\n type CreateOpenAIClientFn,\n} from '@aiscene/shared/env';\n\nexport type * from './types';\nexport {\n ServiceError,\n ExecutionDump,\n ReportActionDump,\n GroupedActionDump,\n type IExecutionDump,\n type IReportActionDump,\n type IGroupedActionDump,\n type ReportMeta,\n type GroupMeta,\n} from './types';\n\nexport { z };\n\nexport default Service;\nexport { TaskRunner, Service, getVersion };\n\nexport type {\n MidsceneYamlScript,\n MidsceneYamlTask,\n MidsceneYamlFlowItem,\n MidsceneYamlConfigResult,\n MidsceneYamlConfig,\n MidsceneYamlScriptWebEnv,\n MidsceneYamlScriptAndroidEnv,\n MidsceneYamlScriptIOSEnv,\n MidsceneYamlScriptEnv,\n LocateOption,\n DetailedLocateParam,\n} from './yaml';\n\nexport { Agent, type AgentOpt, type AiActOptions, createAgent } from './agent';\n\n// Dump utilities\nexport {\n restoreImageReferences,\n escapeContent,\n unescapeContent,\n parseImageScripts,\n parseDumpScript,\n parseDumpScriptAttributes,\n generateImageScriptTag,\n generateDumpScriptTag,\n} from './dump';\n\n// Report generator\nexport type { IReportGenerator } from './report-generator';\nexport { ReportGenerator, nullReportGenerator } from './report-generator';\nexport {\n collectDedupedExecutions,\n ReportMergingTool,\n dedupeExecutionsKeepLatest,\n splitReportHtmlByExecution,\n} from './report';\nexport {\n createReportCliCommands,\n reportFileToMarkdown,\n splitReportFile,\n type ConsumeReportFileAction,\n type ReportFileToMarkdownOptions,\n type ReportCliCommandDefinition,\n type ReportCliCommandEntry,\n type SplitReportFileOptions,\n} from './report-cli';\n\n// ScreenshotItem\nexport { ScreenshotItem } from './screenshot-item';\nexport { ScreenshotStore, type ScreenshotRef } from './dump/screenshot-store';\n\nexport {\n executionToMarkdown,\n reportToMarkdown,\n type ExecutionMarkdownOptions,\n type ExecutionMarkdownResult,\n type ReportMarkdownResult,\n type MarkdownAttachment,\n} from './report-markdown';\n"],"names":["Service"],"mappings":";;;;;;;;;;;;;;;AA0CA,YAAeA"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { z } from 'zod';\nimport Service from './service/index';\nimport { TaskRunner } from './task-runner';\nimport { getVersion } from './utils';\n\nexport {\n plan,\n AiLocateElement,\n runConnectivityTest,\n getMidsceneLocationSchema,\n PointSchema,\n SizeSchema,\n RectSchema,\n TMultimodalPromptSchema,\n TUserPromptSchema,\n type TMultimodalPrompt,\n type TUserPrompt,\n type ConnectivityCheckResultItem,\n type ConnectivityTestConfig,\n type ConnectivityTestResult,\n} from './ai-model/index';\n\nexport {\n MIDSCENE_MODEL_NAME,\n type CreateOpenAIClientFn,\n} from '@aiscene/shared/env';\n\nexport type * from './types';\nexport type {\n DeviceAction,\n} from './types';\nexport {\n ServiceError,\n ExecutionDump,\n ReportActionDump,\n GroupedActionDump,\n type IExecutionDump,\n type IReportActionDump,\n type IGroupedActionDump,\n type ReportMeta,\n type GroupMeta,\n} from './types';\n\nexport { z };\n\nexport default Service;\nexport { TaskRunner, Service, getVersion };\n\nexport type {\n MidsceneYamlScript,\n MidsceneYamlTask,\n MidsceneYamlFlowItem,\n MidsceneYamlConfigResult,\n MidsceneYamlConfig,\n MidsceneYamlScriptWebEnv,\n MidsceneYamlScriptAndroidEnv,\n MidsceneYamlScriptIOSEnv,\n MidsceneYamlScriptEnv,\n LocateOption,\n DetailedLocateParam,\n} from './yaml';\n\nexport { Agent, type AgentOpt, type AiActOptions, createAgent } from './agent';\n\n// Dump utilities\nexport {\n restoreImageReferences,\n escapeContent,\n unescapeContent,\n parseImageScripts,\n parseDumpScript,\n parseDumpScriptAttributes,\n generateImageScriptTag,\n generateDumpScriptTag,\n} from './dump';\n\n// Report generator\nexport type { IReportGenerator } from './report-generator';\nexport { ReportGenerator, nullReportGenerator } from './report-generator';\nexport {\n collectDedupedExecutions,\n ReportMergingTool,\n dedupeExecutionsKeepLatest,\n splitReportHtmlByExecution,\n} from './report';\nexport {\n createReportCliCommands,\n reportFileToMarkdown,\n splitReportFile,\n type ConsumeReportFileAction,\n type ReportFileToMarkdownOptions,\n type ReportCliCommandDefinition,\n type ReportCliCommandEntry,\n type SplitReportFileOptions,\n} from './report-cli';\n\n// ScreenshotItem\nexport { ScreenshotItem } from './screenshot-item';\nexport { ScreenshotStore, type ScreenshotRef } from './dump/screenshot-store';\n\nexport {\n executionToMarkdown,\n reportToMarkdown,\n type ExecutionMarkdownOptions,\n type ExecutionMarkdownResult,\n type ReportMarkdownResult,\n type MarkdownAttachment,\n} from './report-markdown';\n"],"names":["Service"],"mappings":";;;;;;;;;;;;;;;AA6CA,YAAeA"}
@@ -1 +1 @@
1
- {"version":3,"file":"skill/index.mjs","sources":["../../../src/skill/index.ts"],"sourcesContent":["import { CLIError, runToolsCLI } from '@aiscene/shared/cli';\nimport { BaseMidsceneTools } from '@aiscene/shared/mcp';\nimport type { BaseAgent, BaseDevice } from '@aiscene/shared/mcp';\nimport { Agent } from '../agent/agent';\nimport type { AbstractInterface } from '../device';\n\ntype DeviceClass = new (...args: any[]) => AbstractInterface;\n\n/**\n * Skill tools manager that lazily creates Agent from a Device class.\n * Used by runSkillCLI for CLI / Agent Skills scenarios where no agent exists at startup.\n */\nclass SkillMidsceneTools extends BaseMidsceneTools<BaseAgent> {\n constructor(private DeviceClass: DeviceClass) {\n super();\n }\n\n protected createTemporaryDevice(): BaseDevice {\n return new this.DeviceClass() as unknown as BaseDevice;\n }\n\n protected async ensureAgent(): Promise<BaseAgent> {\n if (!this.agent) {\n const device = new this.DeviceClass();\n this.agent = new Agent(device) as unknown as BaseAgent;\n }\n return this.agent;\n }\n}\n\nexport interface SkillCLIOptions {\n scriptName: string;\n DeviceClass: DeviceClass;\n}\n\n/**\n * Launch a Skill CLI for a custom interface Device class.\n * This enables AI coding assistants (Claude Code, Cline, etc.) to control\n * your custom interface through CLI commands.\n *\n * @example\n * ```typescript\n * #!/usr/bin/env node\n * import { runSkillCLI } from '@midscene/core/skill';\n * import { SampleDevice } from './sample-device';\n *\n * runSkillCLI({\n * DeviceClass: SampleDevice,\n * scriptName: 'my-device',\n * });\n * ```\n */\nexport function runSkillCLI(options: SkillCLIOptions): Promise<void> {\n const tools = new SkillMidsceneTools(options.DeviceClass);\n return runToolsCLI(tools, options.scriptName).catch((e) => {\n if (!(e instanceof CLIError)) console.error(e);\n process.exit(e instanceof CLIError ? e.exitCode : 1);\n });\n}\n"],"names":["SkillMidsceneTools","BaseMidsceneTools","device","Agent","DeviceClass","runSkillCLI","options","tools","runToolsCLI","e","CLIError","console","process"],"mappings":";;;;;;;;;;;;;AAYA,MAAMA,2BAA2BC;IAKrB,wBAAoC;QAC5C,OAAO,IAAI,IAAI,CAAC,WAAW;IAC7B;IAEA,MAAgB,cAAkC;QAChD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,MAAMC,SAAS,IAAI,IAAI,CAAC,WAAW;YACnC,IAAI,CAAC,KAAK,GAAG,IAAIC,MAAMD;QACzB;QACA,OAAO,IAAI,CAAC,KAAK;IACnB;IAdA,YAAoBE,WAAwB,CAAE;QAC5C,KAAK,wDADaA,WAAW,GAAXA;IAEpB;AAaF;AAwBO,SAASC,YAAYC,OAAwB;IAClD,MAAMC,QAAQ,IAAIP,mBAAmBM,QAAQ,WAAW;IACxD,OAAOE,YAAYD,OAAOD,QAAQ,UAAU,EAAE,KAAK,CAAC,CAACG;QACnD,IAAI,CAAEA,CAAAA,aAAaC,QAAO,GAAIC,QAAQ,KAAK,CAACF;QAC5CG,QAAQ,IAAI,CAACH,aAAaC,WAAWD,EAAE,QAAQ,GAAG;IACpD;AACF"}
1
+ {"version":3,"file":"skill/index.mjs","sources":["../../../src/skill/index.ts"],"sourcesContent":["import { CLIError, runToolsCLI } from '@aiscene/shared/cli';\nimport { BaseMidsceneTools } from '@aiscene/shared/mcp';\nimport type { BaseAgent, BaseDevice } from '@aiscene/shared/mcp';\nimport { Agent } from '../agent/agent';\nimport type { AbstractInterface } from '../device';\n\ntype DeviceClass = new (...args: any[]) => AbstractInterface;\n\n/**\n * Skill tools manager that lazily creates Agent from a Device class.\n * Used by runSkillCLI for CLI / Agent Skills scenarios where no agent exists at startup.\n */\nclass SkillMidsceneTools extends BaseMidsceneTools<BaseAgent> {\n constructor(private DeviceClass: DeviceClass) {\n super();\n }\n\n protected createTemporaryDevice(): BaseDevice {\n return new this.DeviceClass() as unknown as BaseDevice;\n }\n\n protected async ensureAgent(): Promise<BaseAgent> {\n if (!this.agent) {\n const device = new this.DeviceClass();\n this.agent = new Agent(device) as unknown as BaseAgent;\n }\n return this.agent;\n }\n}\n\nexport interface SkillCLIOptions {\n scriptName: string;\n DeviceClass: DeviceClass;\n}\n\n/**\n * Launch a Skill CLI for a custom interface Device class.\n * This enables AI coding assistants (Claude Code, Cline, etc.) to control\n * your custom interface through CLI commands.\n *\n * @example\n * ```typescript\n * #!/usr/bin/env node\n * import { runSkillCLI } from '@aiscene/core/skill';\n * import { SampleDevice } from './sample-device';\n *\n * runSkillCLI({\n * DeviceClass: SampleDevice,\n * scriptName: 'my-device',\n * });\n * ```\n */\nexport function runSkillCLI(options: SkillCLIOptions): Promise<void> {\n const tools = new SkillMidsceneTools(options.DeviceClass);\n return runToolsCLI(tools, options.scriptName).catch((e) => {\n if (!(e instanceof CLIError)) console.error(e);\n process.exit(e instanceof CLIError ? e.exitCode : 1);\n });\n}\n"],"names":["SkillMidsceneTools","BaseMidsceneTools","device","Agent","DeviceClass","runSkillCLI","options","tools","runToolsCLI","e","CLIError","console","process"],"mappings":";;;;;;;;;;;;;AAYA,MAAMA,2BAA2BC;IAKrB,wBAAoC;QAC5C,OAAO,IAAI,IAAI,CAAC,WAAW;IAC7B;IAEA,MAAgB,cAAkC;QAChD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,MAAMC,SAAS,IAAI,IAAI,CAAC,WAAW;YACnC,IAAI,CAAC,KAAK,GAAG,IAAIC,MAAMD;QACzB;QACA,OAAO,IAAI,CAAC,KAAK;IACnB;IAdA,YAAoBE,WAAwB,CAAE;QAC5C,KAAK,wDADaA,WAAW,GAAXA;IAEpB;AAaF;AAwBO,SAASC,YAAYC,OAAwB;IAClD,MAAMC,QAAQ,IAAIP,mBAAmBM,QAAQ,WAAW;IACxD,OAAOE,YAAYD,OAAOD,QAAQ,UAAU,EAAE,KAAK,CAAC,CAACG;QACnD,IAAI,CAAEA,CAAAA,aAAaC,QAAO,GAAIC,QAAQ,KAAK,CAACF;QAC5CG,QAAQ,IAAI,CAACH,aAAaC,WAAWD,EAAE,QAAQ,GAAG;IACpD;AACF"}