Files

3.0 KiB

Scripts

This directory contains helpers that automate:

  • AI Workspace local service lifecycle
  • context aggregation
  • canonical memory access
  • standup generation
  • manager update drafting
  • Mattermost-ready message formatting
  • historical Slack import

The project-agnostic memory interface lives in:

  • scripts/memory/

Recommended commands:

python3 scripts/aiw/services.py status --profile fidelity
python3 scripts/aiw/services.py doctor --profile fidelity
python3 scripts/aiw/services.py start --profile fidelity

The service manager reads profiles/<profile>/services.json and manages local services such as the Mattermost proxy mirror and Photo Inbox. Runtime PID/state and logs stay under .aiw/runtime/.

The local context MCP server lives in:

  • scripts/mcp/aiw-context-mcp/

It exposes read-only workspace context to local AI clients and is started as the aiw-context-mcp service for profiles that enable it.

Recommended memory commands:

bash scripts/memory/memory.sh health
bash scripts/memory/memory.sh search "PDIAP-15765"
bash scripts/memory/memory.sh create work-item pdiap-15999 "Example title"

This interface resolves the canonical Markdown directory from profiles/<profile>/workspace.json, uses Obsidian CLI when useful and available, and falls back to direct file operations.

The default workspace Mattermost extractor now lives in:

  • scripts/mattermost/

Recommended default command:

bash scripts/mattermost/sync.sh

Bootstrap command:

bash scripts/mattermost/bootstrap.sh

The current Mattermost extractor is stdlib-only and does not require installing requests. It also supports readable channel names in .env, not only channel IDs.

If you want to override it with another script, expose that to OpenCode with:

  • AIW_MATTERMOST_SYNC_CMD

Example:

export AIW_MATTERMOST_SYNC_CMD="/absolute/path/to/your-mattermost-sync-script"

Expected behavior:

  • print the latest relevant Mattermost context to stdout
  • avoid interactive prompts
  • return a non-zero exit code on failure

OpenCode can then use that output to refresh the active profile inbox proactively. When the local Mattermost proxy mirror is running, commands should prefer <profile inbox>/mattermost-mirror/ through scripts/mattermost-proxy/read-context.py --profile <profile>.

Historical Slack exports can also be imported through:

  • python3 scripts/slack/import_slack_export.py ...
  • /archive-import ...
  • /slack-import ...

Recommended raw archive location:

  • archives/slack/export/

The importer can auto-detect channels using AIW_CHANNEL_PREFIX and auto-tune message selection for very large exports. It defaults to fidelity for this project profile.

The Mattermost extractor can also fetch the latest prior day with channel activity for standups. It starts from the previous calendar day and expands backward automatically when there is no activity, which covers Mondays, weekends, holidays, and OOO gaps.

bash scripts/mattermost/sync.sh --previous-workday