synu.plugin.zsh

 1# SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
 2#
 3# SPDX-License-Identifier: Unlicense
 4
 5# synu - Universal agent wrapper with Synthetic API quota tracking
 6# Zsh plugin entry point
 7
 8# Standard $0 handling per Zsh Plugin Standard
 90="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
100="${${(M)0:#/*}:-$PWD/$0}"
11
12typeset -g SYNU_PLUGIN_DIR="${0:h}"
13
14# Add functions directory to fpath for autoloading
15if [[ -z "${fpath[(r)${SYNU_PLUGIN_DIR}/functions]}" ]]; then
16    fpath=("${SYNU_PLUGIN_DIR}/functions" "${SYNU_PLUGIN_DIR}/functions/_synu_agents" $fpath)
17fi
18
19# Add completions directory to fpath
20if [[ -z "${fpath[(r)${SYNU_PLUGIN_DIR}/completions]}" ]]; then
21    fpath=("${SYNU_PLUGIN_DIR}/completions" $fpath)
22fi
23
24# Source the main function and helpers (they define functions internally)
25source "${SYNU_PLUGIN_DIR}/functions/synu.zsh"
26source "${SYNU_PLUGIN_DIR}/functions/_synu_get_quota.zsh"
27source "${SYNU_PLUGIN_DIR}/functions/_synu_cache.zsh"