This commit is contained in:
@@ -144,7 +144,7 @@ export function ToolsExternalForm({ config, onChange }: SectionFormProps) {
|
||||
checked={tools.userScriptsEnabled === true}
|
||||
onChange={e => onChange('tools.userScriptsEnabled', e.target.checked)}
|
||||
/>
|
||||
<span>有効 (LLM の RunUserScript + scheduled script task が動作)</span>
|
||||
<span>有効 (browser-macros: LLM の RunUserScript + scheduled script task が動作)</span>
|
||||
</label>
|
||||
<HelpText>
|
||||
plain runtime は Node <code>--permission</code> で sandbox 化され child_process / worker / tmpdir 外の FS アクセスを deny。
|
||||
@@ -160,7 +160,7 @@ export function ToolsExternalForm({ config, onChange }: SectionFormProps) {
|
||||
placeholder="user id (例: 12345)"
|
||||
/>
|
||||
<HelpText>
|
||||
未指定なら <code>user_scripts_enabled</code> のみで制御。設定すると指定 ID のみ RunUserScript / scheduled script task が許可される。
|
||||
未指定なら <code>user_scripts_enabled</code> のみで制御。設定すると指定 ID のみ browser-macro の実行 (RunUserScript / scheduled script task) が許可される。
|
||||
</HelpText>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -270,7 +270,7 @@ export function ToolsForm({ config, onChange, visibleTabs }: ToolsFormProps) {
|
||||
checked={tools.userScriptsEnabled === true}
|
||||
onChange={e => onChange('tools.userScriptsEnabled', e.target.checked)}
|
||||
/>
|
||||
<span>有効 (LLM の RunUserScript + scheduled script task が動作)</span>
|
||||
<span>有効 (browser-macros: LLM の RunUserScript + scheduled script task が動作)</span>
|
||||
</label>
|
||||
<HelpText>
|
||||
plain runtime は Node <code>--permission</code> で sandbox 化され child_process / worker / tmpdir 外の FS アクセスを deny。
|
||||
@@ -286,7 +286,7 @@ export function ToolsForm({ config, onChange, visibleTabs }: ToolsFormProps) {
|
||||
placeholder="user id (例: 12345)"
|
||||
/>
|
||||
<HelpText>
|
||||
未指定なら <code>user_scripts_enabled</code> のみで制御。設定すると指定 ID のみ RunUserScript / scheduled script task が許可される。
|
||||
未指定なら <code>user_scripts_enabled</code> のみで制御。設定すると指定 ID のみ browser-macro の実行 (RunUserScript / scheduled script task) が許可される。
|
||||
</HelpText>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
// 'agents-md', 'browser-sessions', 'mcp', 'skills', 'pets', 'ssh-connections' are virtual subdirs (not raw file editor directories)
|
||||
export type SubdirId = 'agents-md' | 'scripts' | 'browser-macros' | 'templates' | 'recordings' | 'trash' | 'memory' | 'browser-sessions' | 'mcp' | 'skills' | 'pets' | 'ssh-connections' | 'notes' | 'subscribed-notes';
|
||||
// ('scripts' / 'templates' were retired 2026-06 — superseded by Skills + the Bash tool)
|
||||
export type SubdirId = 'agents-md' | 'browser-macros' | 'recordings' | 'trash' | 'memory' | 'browser-sessions' | 'mcp' | 'skills' | 'pets' | 'ssh-connections' | 'notes' | 'subscribed-notes';
|
||||
|
||||
/** True for subdirs that have actual files on disk */
|
||||
export const FILE_SUBDIRS: SubdirId[] = ['scripts', 'browser-macros', 'templates', 'recordings', 'trash', 'memory', 'notes'];
|
||||
export const FILE_SUBDIRS: SubdirId[] = ['browser-macros', 'recordings', 'trash', 'memory', 'notes'];
|
||||
|
||||
export interface FileEntry {
|
||||
name: string;
|
||||
@@ -29,9 +30,7 @@ interface FileTreeProps {
|
||||
|
||||
const SUBDIR_LABELS: Record<SubdirId, string> = {
|
||||
'agents-md': 'AGENTS.md',
|
||||
scripts: 'scripts',
|
||||
'browser-macros': 'browser-macros',
|
||||
templates: 'templates',
|
||||
recordings: 'recordings',
|
||||
trash: 'trash',
|
||||
memory: 'memory',
|
||||
@@ -46,9 +45,7 @@ const SUBDIR_LABELS: Record<SubdirId, string> = {
|
||||
|
||||
const SUBDIR_ICONS: Record<SubdirId, string> = {
|
||||
'agents-md': '📖',
|
||||
scripts: '📜',
|
||||
'browser-macros': '🤖',
|
||||
templates: '📄',
|
||||
recordings: '🎬',
|
||||
trash: '🗑',
|
||||
memory: '🧠',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
type WritableSubdir = 'scripts' | 'browser-macros' | 'templates';
|
||||
type WritableSubdir = 'browser-macros';
|
||||
|
||||
interface NewFileFormProps {
|
||||
subdir: WritableSubdir;
|
||||
@@ -11,23 +11,6 @@ interface NewFileFormProps {
|
||||
const TODAY = new Date().toISOString().slice(0, 10);
|
||||
|
||||
const SKELETON: Record<WritableSubdir, { ext: string; body: string }> = {
|
||||
scripts: {
|
||||
ext: '.js',
|
||||
body: `---
|
||||
description: <short summary>
|
||||
params:
|
||||
# name: { type: string, required: true, description: "..." }
|
||||
---
|
||||
|
||||
/**
|
||||
* Generated ${TODAY} via User Folder UI.
|
||||
*/
|
||||
export async function main({ params }) {
|
||||
console.log('script start', params);
|
||||
return { ok: true };
|
||||
}
|
||||
`,
|
||||
},
|
||||
'browser-macros': {
|
||||
ext: '.js',
|
||||
body: `---
|
||||
@@ -45,27 +28,12 @@ export async function main({ context, params }) {
|
||||
// await page.goto(params.url);
|
||||
return { ok: true };
|
||||
}
|
||||
`,
|
||||
},
|
||||
templates: {
|
||||
ext: '.md',
|
||||
body: `---
|
||||
description: <short summary>
|
||||
params:
|
||||
# title: { type: string, required: true }
|
||||
---
|
||||
|
||||
# {{title}}
|
||||
|
||||
Content here.
|
||||
`,
|
||||
},
|
||||
};
|
||||
|
||||
const SUBDIR_LABEL: Record<WritableSubdir, string> = {
|
||||
scripts: 'スクリプト',
|
||||
'browser-macros': 'ブラウザマクロ',
|
||||
templates: 'テンプレート',
|
||||
};
|
||||
|
||||
export function NewFileForm({ subdir, existingFilenames, onCreate }: NewFileFormProps) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { NotesPanel } from './NotesPanel';
|
||||
import { SubscriptionsPanel } from './SubscriptionsPanel';
|
||||
import { SkillsPanel } from './SkillsPanel';
|
||||
/** All subdirs shown in the tree — both real file-based and virtual. */
|
||||
const ALL_SUBDIRS: SubdirId[] = ['agents-md', 'scripts', 'browser-macros', 'templates', 'recordings', 'notes', 'subscribed-notes', 'pets', 'browser-sessions', 'mcp', 'skills', 'ssh-connections', 'trash', 'memory'];
|
||||
const ALL_SUBDIRS: SubdirId[] = ['agents-md', 'browser-macros', 'recordings', 'notes', 'subscribed-notes', 'pets', 'browser-sessions', 'mcp', 'skills', 'ssh-connections', 'trash', 'memory'];
|
||||
|
||||
const SUBDIR_INFO: { id: SubdirId; icon: string; title: string; desc: string; agency: string }[] = [
|
||||
{
|
||||
@@ -24,27 +24,13 @@ const SUBDIR_INFO: { id: SubdirId; icon: string; title: string; desc: string; ag
|
||||
desc: 'タスク起動時に system prompt へ自動注入される、ユーザー専用の永続的な指示。 「常に丁寧な日本語で答える」「Tailwind を優先」等、毎タスクで覚えて欲しい好み・ルールを書く。 最大 64KB。 ファイル形式は markdown。',
|
||||
agency: 'ユーザー編集 / エージェントが自動参照',
|
||||
},
|
||||
{
|
||||
id: 'scripts',
|
||||
icon: '📜',
|
||||
title: 'scripts/',
|
||||
desc: 'AI 生成の汎用 Node スクリプト。エージェントが RunUserScript ツールで実行 (kind: "script")。Chromium 起動なし、main({ params }) シグネチャ。データ整形・API 呼び出し・計算・ファイル変換等の繰り返し処理に向く。',
|
||||
agency: 'エージェント/ユーザー両方 / 軽量・高速',
|
||||
},
|
||||
{
|
||||
id: 'browser-macros',
|
||||
icon: '🤖',
|
||||
title: 'browser-macros/',
|
||||
desc: 'Playwright ベースのブラウザマクロ。recordings/ から "Save as Script" で生成、または UI で手書き。RunUserScript ツール (kind: "browser-macro") で実行。main({ context, params }) シグネチャで context は Playwright BrowserContext。session_profile_id で保存済みログインを利用可能。.next.js は self-healing 失敗時の自動パッチ候補で、Diff レビュー後に accept/reject。',
|
||||
desc: 'Playwright ベースのブラウザマクロ。recordings/ から "Save as Script" で生成、または UI で手書き。RunUserScript ツールで実行。main({ context, params }) シグネチャで context は Playwright BrowserContext。session_profile_id で保存済みログインを利用可能。.next.js は self-healing 失敗時の自動パッチ候補で、Diff レビュー後に accept/reject。雛形・手順書は Skills へ、アドホックなコード実行は Bash ツールへ。',
|
||||
agency: 'エージェント実行 / UI で recordings → スクリプト化',
|
||||
},
|
||||
{
|
||||
id: 'templates',
|
||||
icon: '📄',
|
||||
title: 'templates/',
|
||||
desc: '定型文・雛形の置き場。UI で作成・編集する。エージェントが ReadUserTemplate で本文を読むか、RenderUserTemplate で frontmatter.params の {{var}} を埋めた結果を取得できる。報告書の雛形・メール文面・コードボイラープレート等を貯めておくと、繰り返しタスクで「雛形を埋めて」と指示しやすい。',
|
||||
agency: 'ユーザー作成 / エージェントが ReadUserTemplate / RenderUserTemplate で利用',
|
||||
},
|
||||
{
|
||||
id: 'recordings',
|
||||
icon: '🎬',
|
||||
@@ -186,7 +172,7 @@ async function apiFolderDelete(subdir: SubdirId, path: string): Promise<void> {
|
||||
const VIRTUAL_SUBDIRS = new Set<SubdirId>(['agents-md', 'browser-sessions', 'mcp', 'skills', 'pets', 'ssh-connections', 'subscribed-notes']);
|
||||
|
||||
/** Subdirs where users can create new files from the UI */
|
||||
const WRITABLE_USER_SUBDIRS = new Set<SubdirId>(['scripts', 'browser-macros', 'templates']);
|
||||
const WRITABLE_USER_SUBDIRS = new Set<SubdirId>(['browser-macros']);
|
||||
|
||||
type ShowToast = (message: string, variant?: 'success' | 'error') => void;
|
||||
|
||||
@@ -195,7 +181,7 @@ interface UserFolderTabProps {
|
||||
}
|
||||
|
||||
export function UserFolderTab({ showToast }: UserFolderTabProps = {}) {
|
||||
const [selectedSubdir, setSelectedSubdir] = useState<SubdirId | null>('scripts');
|
||||
const [selectedSubdir, setSelectedSubdir] = useState<SubdirId | null>('browser-macros');
|
||||
const [selectedFile, setSelectedFile] = useState<string | null>(null);
|
||||
const [editorDirty, setEditorDirty] = useState(false);
|
||||
const [saveAsDialogOpen, setSaveAsDialogOpen] = useState(false);
|
||||
@@ -475,7 +461,7 @@ export function UserFolderTab({ showToast }: UserFolderTabProps = {}) {
|
||||
</div>
|
||||
)}
|
||||
<NewFileForm
|
||||
subdir={selectedSubdir as 'scripts' | 'browser-macros' | 'templates'}
|
||||
subdir={selectedSubdir as 'browser-macros'}
|
||||
existingFilenames={files.map(f => f.name)}
|
||||
onCreate={async (filename, skeleton) => {
|
||||
await apiFolderPut(selectedSubdir, filename, skeleton);
|
||||
|
||||
@@ -3,12 +3,12 @@ id: userfolder
|
||||
title: User Folder(自分の資産)
|
||||
category: advanced
|
||||
order: 90
|
||||
keywords: [User Folder, AGENTS.md, notes, scripts, browser-macros, templates, browser-sessions]
|
||||
keywords: [User Folder, AGENTS.md, notes, browser-macros, browser-sessions, recordings]
|
||||
---
|
||||
|
||||
# User Folder(自分の資産)
|
||||
|
||||
User Folder は、ユーザーごとに永続化される個人の資産置き場です。エージェントへの恒久指示、共有メモ、自作スクリプト、ブラウザ自動化、ログイン済みセッションなどがここに集まり、タスクをまたいで「あなた仕様」のエージェントを作り込めます。
|
||||
User Folder は、ユーザーごとに永続化される個人の資産置き場です。エージェントへの恒久指示、共有メモ、ブラウザ自動化、ログイン済みセッションなどがここに集まり、タスクをまたいで「あなた仕様」のエージェントを作り込めます。
|
||||
|
||||
TopBar → **ユーザーフォルダ** タブで開きます。左にサブフォルダのツリー、右にファイルエディタ(または専用パネル)という 2 カラム構成です。
|
||||
|
||||
@@ -18,9 +18,7 @@ TopBar → **ユーザーフォルダ** タブで開きます。左にサブフ
|
||||
|---|---|---|
|
||||
| AGENTS.md | タスク起動時に system prompt へ注入される恒久指示 | ユーザー |
|
||||
| notes/ | 共有可能な Markdown メモ(エージェントが検索・参照) | ユーザー |
|
||||
| scripts/ | 汎用 Node スクリプト(RunUserScript で実行) | ユーザー / エージェント |
|
||||
| browser-macros/ | Playwright ブラウザマクロ | ユーザー / エージェント |
|
||||
| templates/ | 定型文・雛形(`{{var}}` プレースホルダ) | ユーザー |
|
||||
| recordings/ | BrowseWeb の操作トレース(JSON) | エージェント |
|
||||
| pets/ | Chat 画面に表示するキャラクター | ユーザー |
|
||||
| browser-sessions/ | 保存済みログインプロファイル(cookie / storage) | ユーザー |
|
||||
@@ -55,28 +53,13 @@ TopBar → **ユーザーフォルダ** タブで開きます。左にサブフ
|
||||
|
||||
他のエージェントや他ユーザーと共有したい情報を Markdown で書く場所です。visibility(公開範囲)を設定でき、エージェントは `SearchNotes` / `ReadNote` / `WriteNote` でアクセスします。notes はフォルダ階層を持てます(`notes/<folder>/<file>.md`)。
|
||||
|
||||
## scripts/(汎用 Node)
|
||||
|
||||
繰り返し処理を Node スクリプトとして保存します。エージェントは `RunUserScript`(kind: script)で実行します。Chromium は起動せず、`main({ params })` シグネチャです。データ整形・API 呼び出し・計算・ファイル変換などに向きます。
|
||||
|
||||
作成方法:
|
||||
|
||||
1. ユーザーフォルダ → **scripts** → 新規ファイルフォーム
|
||||
2. ファイル名(`.js`)と内容を入力 → 作成
|
||||
|
||||
「○○するスクリプトを作って」とエージェントに頼むと自動生成されることもあります。
|
||||
|
||||
## browser-macros/(Playwright)
|
||||
|
||||
ログイン済みブラウザを使った Web 操作を自動化します。`RunUserScript`(kind: browser-macro)で実行され、`main({ context, params })` の `context` は Playwright の BrowserContext です。`session_profile_id` を指定すると保存済みログイン(browser-sessions/)を復元してから実行します。
|
||||
ログイン済みブラウザを使った Web 操作を自動化します。`RunUserScript` で実行され、`main({ context, params })` の `context` は Playwright の BrowserContext です。`session_profile_id` を指定すると保存済みログイン(browser-sessions/)を復元してから実行します。
|
||||
|
||||
recordings/ の操作トレースから「Save as Script」でマクロ化することもできます。
|
||||
|
||||
> scripts/ は外部 API を呼ぶ汎用処理、browser-macros/ は Web UI を操作する処理、と使い分けます。混ぜないこと。
|
||||
|
||||
## templates/(定型文・雛形)
|
||||
|
||||
`{{var}}` プレースホルダ付きの雛形です。エージェントは `ReadUserTemplate` で本文を読むか、`RenderUserTemplate` で frontmatter の `params` を埋めた結果を取得します。週次レポートや議事録など、定型フォーマットがあるタスクで効きます。
|
||||
> 以前あった scripts/(汎用 Node)と templates/(雛形)は廃止されました。雛形・手順書は **Skills** に、アドホックなコード実行はエージェントの **Bash** ツールに統一されています。
|
||||
|
||||
## browser-sessions/
|
||||
|
||||
@@ -100,6 +83,6 @@ CAPTCHA / 2FA を越えて取得した cookie / storage を user-scoped に暗
|
||||
|
||||
## ファイルの作成・編集
|
||||
|
||||
- 作成できるのは **scripts / browser-macros / templates** の 3 つ(左ツリーで選択 → 新規ファイルフォーム)
|
||||
- 作成できるのは **browser-macros**(左ツリーで選択 → 新規ファイルフォーム)
|
||||
- 既存ファイルはツリーから選んでエディタで編集 → 保存
|
||||
- AGENTS.md・browser-sessions・mcp・skills・pets・ssh-connections・Subscribed Notes は専用パネルで操作します
|
||||
|
||||
@@ -30,7 +30,7 @@ movement の開始時には、その movement で使えるツールの一覧と
|
||||
| レビュー | LLM による一括レビュー | BatchReviewTextWithLLM |
|
||||
| スライド | PPTX スライド生成 | AddSlide / BuildPptx / SetTheme |
|
||||
| チェックリスト | タスク内の進捗チェックリスト | CreateChecklist / CheckItem |
|
||||
| ノート / テンプレート | 共有ノート・ユーザーテンプレート | SearchNotes / ReadNote / RenderUserTemplate |
|
||||
| ノート | 共有ノートの検索・読み書き | SearchNotes / ReadNote / WriteNote |
|
||||
| SSH | リモート実行・転送・対話コンソール | SshExec / SshUpload / SshConsoleSend |
|
||||
| オーケストレーション | サブタスクの生成 | SpawnSubTask |
|
||||
| 地図 | 場所検索・経路・逆ジオコーディング | SearchPlaces / GetDirections |
|
||||
|
||||
Reference in New Issue
Block a user