梅澤 真史 https://github.com/mumez/pharo-agentic-browser
st-eval
seq:
para:
topicBy:
agentBy:
eval
AgenticBrowser runBy: [ :builder | builder seq: { builder topicBy: [ :t | t prompt: 'List 3 Pharo Smalltalk features.' ]. builder topicBy: [ :t | t prompt: 'Write a one-sentence summary of previous features.' ]. } agentBy: [ :a | a claude ] ].
resume
コアパッケージと合わせて Scripting パッケージをロード:
Metacello new baseline: 'AgenticBrowser'; repository: 'github://mumez/pharo-agentic-browser:main/src'; load: 'Scripting'.
テストスイートもロードする場合:
Metacello new baseline: 'AgenticBrowser'; repository: 'github://mumez/pharo-agentic-browser:main/src'; load: 'Scripting-Tests'.
runBy: はオーケストレーションを構築してすぐに実行し、完了までブロック:
runBy:
AgenticBrowser runBy: [ :builder | builder seq: { builder topicBy: [ :t | t title: 'List Pharo features'. t prompt: 'List 3 Pharo Smalltalk features in one sentence each.' ] } agentBy: [ :a | a claude ] ].
scriptBy: は実行せずに構築だけを行い、後で確認したり forkRun したりが可能
scriptBy:
forkRun
各トピックの結果は、次のトピックのプロンプトに引き継がれる:
AgenticBrowser runBy: [ :builder | builder seq: { builder topicBy: [ :t | t prompt: 'List 3 Pharo Smalltalk features in one sentence each.' ]. builder topicBy: [ :t | t prompt: 'Summarize the feature list from the previous step in one sentence.' ] } agentBy: [ :a | a claude ] ].
トピックは並行実行され、結果は次のステップのためにまとめられる:
AgenticBrowser runBy: [ :builder | builder para: { builder topicBy: [ :t | t prompt: 'List 3 Pharo Smalltalk language features.' ]. builder topicBy: [ :t | t prompt: 'List 3 Pharo Smalltalk development tools.' ] } agentBy: [ :a | a claude ] ].
seq: と para: は自由に組み合わせ可能 — 例: 並列調査 → 逐次統合
異なるエージェントで2つの候補を実行し、勝者を選ぶ:
AgenticBrowser groupRunBy: [ :groupBuilder | groupBuilder para: { groupBuilder orchestrationBy: [ :b | b seq: { b topicBy: [ :t | t prompt: 'Implement feature XXX.'. t goal: 'all tests pass' ] } agentBy: [ :a | a claude ] ]. groupBuilder orchestrationBy: [ :b | b seq: { b topicBy: [ :t | t prompt: 'Implement feature XXX.'. t goal: 'all tests pass' ] } agentBy: [ :a | a codex ] ] }. groupBuilder singleTopicBy: [ :t | t prompt: 'Pick the best implementation above and open a PR.' ] agentBy: [ :a | a kilo ] ].
完全なサンプルはリポジトリのドキュメントを参照: to-do-list-orchestration-script.md
goal:
ab-scripting-feature-dev
docs/scripting-features/feature-<name>.scripting.md
sharedDirectoryPath:
AbOrchestrationManager
このスキルは単なるデモにとどまらず、実際の機能を生み出した
同期実行 — runBy: / script run はすべて完了するまでブロック
script run
バックグラウンド実行 — 長時間かかるオーケストレーション向け:
script forkRunThen: [ :orc | Transcript crShow: 'Done: ' , orc result ]. "... later, if needed:" script isRunning.
forkRun は forkRunThen: [ :orc | ] の省略形
forkRunThen: [ :orc | ]
実行中のオーケストレーションをキャンセル:
script terminate.
ステップがタイムアウトした後にレジューム(最初の未完了ステップから、記録済みの結果を再利用して再開):
script resume.
Fuel でオーケストレーション(やグループ)を永続化(実行前/後どちらも可):
script save. "-> <sharedDirectoryPath>/<name>.fuel" script saveTo: '/path/to/my-script.fuel' asFileReference. loaded := AbTopicOrchestration loadFrom: '/path/to/my-script.fuel'. loaded result. "results from the saved run" loaded resume. "continue if the saved run stopped early"
orchestrationLoadFrom:
orchestrationStepWaitTimeoutSeconds
orchestrationGroupItemWaitTimeoutSeconds
グローバル、またはオーケストレーション/グループごとに調整可能:
script settings orchestrationStepWaitTimeoutSeconds: 1800.
lingerOrchestrationTopicsAfterRun
false
true
script settings lingerOrchestrationTopicsAfterRun: true.
Scripting API は、コード駆動によるヘッドレスなオーケストレーションを AgenticBrowser にもたらす:
https://github.com/mumez/pharo-agentic-browser