Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ venv.bak/
# Local models and benchmark artifacts (never publish)
/artifacts/
/output/
/benchmarks/results/
/benchmarks/*/results/
/benchmarks/profiles/
*.bin
*.safetensors
*.gguf
Expand Down Expand Up @@ -114,6 +117,7 @@ temp/
packaging/_wheels/
packaging/_export/
packaging/_build/
packaging/_release_wheels/
.build/
.swiftpm/
node_modules/
Expand Down
116 changes: 115 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,119 @@ before dynamic cache replacement work begins.

## Notice:
- The current AI2Apps desktop client has bundle ID `com.ai2apps.desktop`.
- Never launch or control the retired `com.electron.ai2apps` client or its build output.
- The desktop implementation lives under `apps/ai2apps-acefox`.
- The current development App must always use the stable path
`apps/ai2apps-acefox/.build/AI2Apps-dev.app`. Do not create a new current App
name for each feature or iteration. `scripts/build-dev-app.sh` archives the
previous development App under `.build/archive/` before replacing this path.
Release builds remain named `AI2Apps.app`.
- When using Computer Use, identify AI2Apps by its exact bundle ID or executable path, not only by display name.

## AI2Apps Cloud change boundary

- When work involves changes to AI2Apps backend Cloud APIs or any related
Cloud-side behavior, do not modify Cloud-side code directly from this
repository.
- Instead, write a change-requirements document describing the required Cloud
changes and give it to the user. The user will hand it off to the Cloud
development project for implementation, deployment, and upgrade.

## AI2Apps browser control

- `docs/ai2apps-browser-control-architecture.md` is authoritative for all
AceFox, Chat Sidebar, Knowledge webpage import, and WebAgent browser work.
- WebDriver BiDi is the single browser-control protocol. Main App and trusted
Mini-Entries must receive the complete protocol through an authenticated,
protocol-transparent Gateway; do not duplicate the BiDi method catalog as a
semantic REST, WebSocket, Python, or JavaScript browser API.
- Shared Readability, page-stability, cookie-consent, screenshot, and input
helpers must be implemented as client SDK helpers on top of native BiDi.
- Do not add JSWindowActor messages for DOM extraction, screenshots, or browser
interaction. Firefox UI code may only bootstrap the protected BiDi session,
enforce trust, and bind a Sidebar mount to an explicit active BiDi browsing
context.
- Never expose AceFox's raw debugging endpoint or bearer credential to Local
HTML. Use actor-, Profile-, App-, and mount-bound Gateway sessions.

## Apple release credentials

- When asking the user to create the AI2Apps `notarytool` Keychain profile,
prefill the known non-secret account fields and prompt only for the
app-specific password:
`xcrun notarytool store-credentials ai2apps-notary --apple-id avdpro@me.com --team-id 84XL5V265N`.
- Never put an app-specific password, App Store Connect private key contents,
or another Apple secret directly on the command line or in chat. Let
`notarytool` collect the password through its secure interactive prompt, or
use an already configured Keychain profile.

## AI2Apps Package publication

- `docs/ai2apps-package-publication-runbook.md` is the authoritative release
procedure. Read it completely before building or publishing any Package.
- Agent-driven production publication must use the existing signed-artifact
builders and `scripts/publish_signed_registry_artifact.py`; do not improvise
with browser automation, ad-hoc `curl`, direct Cloud database writes, or a
second publication implementation. Discover may be used to inspect and
verify the published result.
- Use only the runbook's fixed entry points:
`scripts/build_signed_registry_release.py`,
`scripts/build_omlx_runtime_dmg.py`,
`scripts/build_omlx_runtime_package.py`, and
`scripts/publish_signed_registry_artifact.py`.
- Use the existing Publisher and registered Publisher key from the confirmed
release context. Never create or switch to another Publisher, key, Package
ID, or version merely to work around a publication failure.
- When the Publish page requests administrator verification, open
**Account → Security → Administrator verification**, then hand control to the
user so they can enter the administrator password and select
**Verify administrator**. Never ask for, read, type, or store that password.
- Prefer the Installation Cloud session. If publication requires the current
administrator browser session, do not read browser cookies, browser profiles,
session databases, or Cloud tokens until the user explicitly authorizes
Cookie access for the exact Package and version being published. That grant
expires when the named publication finishes and does not carry to another
task. Pass only the exact current profile's `cookies.sqlite` path to the
standard script; never copy, export, print, probe, or try multiple Cookie
databases.
- If a submission was created before a later step failed, query it and resume
with `--submission-id`; never blindly submit the same release again.
- For dependent releases, publish the Runtime first and verify its published
status before publishing model Packages that require that Runtime.

## AI2Apps Desktop publication

- `docs/ai2apps-desktop-release-runbook.md` is the authoritative end-to-end
procedure for building, Developer ID signing, notarizing, publishing, and
rolling out the macOS Desktop App. Read it completely before every Desktop
release; it is distinct from the Package publication runbook above.
- `docs/ai2apps-desktop-next-release.md` is the authoritative rolling ledger for
work completed after the current production Build. Update it in the same turn
as every change that must be evaluated for a future Desktop Release. Before
building, reconcile every open ledger item with the candidate scope; after
end-to-end publication, archive included items into the immutable Build
receipt and advance the ledger baseline. Never infer the next Release scope
only from a dirty worktree or commit diff.
- Ledger maintenance is automatic and does not require a user reminder. Whenever
an agent creates, modifies, fixes, removes, or materially reconfigures content
that can change the shipped AI2Apps Desktop App, its embedded components, or
its release/installation/update behavior, the agent must create or update the
corresponding ledger item before ending that turn. Pure investigation with
no releasable change need not create an item; once implementation begins, the
item is mandatory even if the work remains `in_progress` or `blocked`.
- Use the checked-in App/DMG/metadata/manifest scripts. Publish GitHub assets to
`Avdpro/ai2apps` with an immutable Release tag and publish the identical
artifacts to `ai2apps/desktop-releases` through `modelscope_hub.HubApi` with
cached credentials. Do not substitute browser upload, git-lfs, mutable
revisions, or token-bearing URLs.
- Preserve the fixed `com.ai2apps.desktop`, `default`, `arm64`, Developer ID,
`RUNTIME_PROFILE=cloud`, and `SANDBOX_MODE=0` contracts unless the user has
explicitly approved a product-level migration. Never remove the compact
Cloud Runtime merely to reduce the DMG size.
- Do not edit production `stable.json` or Cloud storage directly. Hand the
dual-source manifest and verified local artifacts to the protected Cloud
release workflow for schema/full-download/Range/SHA-256/notarization
preflight, audited zero-percent publication, rollout, and production probes.
- A Desktop publication is incomplete until both immutable origins are
verified, the Cloud endpoint passes production acceptance, and an eligible
Mac completes an end-to-end upgrade. Record a release receipt, and never
expose Apple, GitHub, ModelScope, Cookie, or redirect-signature secrets.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ nodes can expose the same model and Service capabilities.

[中文说明](README.zh.md) ·
[Platform architecture](docs/ai2apps-platform-architecture.md) ·
[ACPF capability provisioning](docs/ai2apps-capability-provisioning-framework-v1.md) ·
[Backend plan](docs/ai2apps-backend-development-plan.md) ·
[Local Knowledge/RAG](docs/ai2apps-local-knowledge-rag-architecture.md) ·
[Security baseline](docs/security-authority-baseline.md) ·
Expand Down Expand Up @@ -190,6 +191,10 @@ other policies with representative prompts before deployment.

## Development and release gates

Before developing an AI2Apps App or System App, read the
[AI2Apps App development guide](docs/ai2apps-app-development-guide.md), including
the shared cross-environment Artifact download UX contract.

Before developing an installable Service or model Package, read the
[Service/Package runtime and Sandbox development guide](docs/service-package-sandbox-development-guide.md).
For the Model Worker protocol, Adapter API, and checkpoint contract, see the
Expand Down
5 changes: 5 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ AMD/ROCm 节点也可以暴露相同的模型与 Service 能力。

[English](README.md) ·
[平台架构](docs/ai2apps-platform-architecture.md) ·
[ACPF 能力配置框架](docs/ai2apps-capability-provisioning-framework-v1.md) ·
[后端计划](docs/ai2apps-backend-development-plan.md) ·
[本地 Knowledge/RAG](docs/ai2apps-local-knowledge-rag-architecture.md) ·
[安全基线](docs/security-authority-baseline.md) ·
Expand Down Expand Up @@ -173,6 +174,10 @@ ai2apps serve --model-dir /path/to/models

## 开发与发布门槛

开发 AI2Apps App 或 System App 前,请先阅读
[AI2Apps App 开发指南](docs/ai2apps-app-development-guide.md),其中包括统一的跨宿主
Artifact 下载 UE 约定。

开发可安装 Service 或模型 Package 前,请先阅读
[Service/Package 运行模式与 Sandbox 开发指南](docs/service-package-sandbox-development-guide.md);
Model Worker 的协议、Adapter 和 checkpoint 约定见
Expand Down
77 changes: 77 additions & 0 deletions ai2apps/agent_builder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"""Natural-language browser Agent authoring and local compilation."""

from .compiler import (
COMPILER_VERSION,
POLICY_VERSION,
CompileResult,
compile_source,
)
from .models import (
AgentCapabilityHealthRecord,
AgentDraftRecord,
AgentDraftStatus,
AgentHealthStatus,
AgentRecipeRecord,
AgentRepairCandidateRecord,
AgentScheduleDispatchRecord,
AgentScheduleKind,
AgentScheduleRecord,
AgentScheduleStatus,
AgentSiteStateRecord,
AgentType,
AgentWorkflowRecord,
CompileGenerationRecord,
CompileGenerationStatus,
SiteAgentPackageBindingRecord,
StepEvidenceRecord,
StepOutcome,
)
from .packages import SiteAgentPackageService, validate_web_agent_package
from .reliability import AgentReliabilityService, classify_failure
from .repository import AgentBuilderRepository
from .scheduler import AgentScheduleRunner
from .service import (
active_generation,
capability_ir,
create_active_draft_run,
create_ir_run,
create_workflow_run,
workflow_ir,
)

__all__ = [
"AgentBuilderRepository",
"AgentDraftRecord",
"AgentDraftStatus",
"AgentCapabilityHealthRecord",
"AgentHealthStatus",
"AgentRecipeRecord",
"AgentScheduleDispatchRecord",
"AgentScheduleKind",
"AgentScheduleRecord",
"AgentScheduleStatus",
"AgentType",
"AgentWorkflowRecord",
"AgentRepairCandidateRecord",
"AgentSiteStateRecord",
"COMPILER_VERSION",
"CompileGenerationRecord",
"CompileGenerationStatus",
"CompileResult",
"POLICY_VERSION",
"StepEvidenceRecord",
"StepOutcome",
"SiteAgentPackageBindingRecord",
"SiteAgentPackageService",
"AgentReliabilityService",
"classify_failure",
"validate_web_agent_package",
"compile_source",
"active_generation",
"create_active_draft_run",
"capability_ir",
"create_ir_run",
"create_workflow_run",
"AgentScheduleRunner",
"workflow_ir",
]
Loading
Loading