openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
5 lines • 3.35 kB
JavaScript
import{r as createLazyRuntimeModule}from"../../lazy-runtime-Ds6M7vp4.mjs";import{t as defineSingleProviderPluginEntry}from"../../provider-entry-CTyJ4-xs.mjs";import{i as APPLE_FM_PROVIDER_ID,t as APPLE_FM_LOCAL_AUTH_MARKER}from"../../defaults-lT3Be58h.mjs";import path from"node:path";
//!extensions/apple-fm/openclaw.plugin.json
var openclaw_plugin_default={id:`apple-fm`,name:`Apple Foundation Models`,description:`On-device Apple Intelligence inference for lightweight setup and short tasks.`,categories:[`models`],activation:{"onStartup":false},enabledByDefaultOnPlatforms:[`darwin`],autoEnableWhenConfiguredProviders:[`apple-fm`],providers:[`apple-fm`],syntheticAuthRefs:[`apple-fm`],nonSecretAuthMarkers:[`apple-fm-local`],modelPricing:{"providers":{"apple-fm":{"external":false}}},setup:{"providers":[{"id":`apple-fm`,"authMethods":[`local`]}]},providerAuthChoices:[{"provider":`apple-fm`,"method":`local`,"choiceId":`apple-fm`,"platforms":[`darwin`],"assistantVisibility":`detected-only`,"modelTarget":`utility`,"choiceLabel":`Apple Foundation Models (on-device)`,"choiceHint":`Free on-device setup and utility tasks; choose a separate model for your agent`,"groupId":`apple-fm`,"groupLabel":`Apple Foundation Models`,"groupHint":`On-device, no API key`,"onboardingFeatured":true,"appGuidedDiscovery":true,"appGuidedActionLabel":`Set up on this Mac`}],configSchema:{"type":`object`,"additionalProperties":false,"properties":{}}};
//!extensions/apple-fm/index.ts
const loadSetup=createLazyRuntimeModule(()=>import(`./setup.js`));const loadStream=createLazyRuntimeModule(()=>import(`./stream.js`));var apple_fm_default=defineSingleProviderPluginEntry({id:APPLE_FM_PROVIDER_ID,name:`Apple Foundation Models`,description:`On-device Apple Intelligence inference for lightweight OpenClaw setup`,manifest:openclaw_plugin_default,provider:e=>{const t=e.rootDir??path.dirname(e.source);const n=createLazyRuntimeModule(async()=>(await import(`./native.js`)).createAppleFmNative(t));const nativeStream=async(...e)=>(await loadStream()).createAppleFmStream(await n())(...e);return{label:`Apple Foundation Models`,docsPath:`/plugins/apple-fm`,extraAuth:[{id:`local`,label:`Apple Foundation Models (on-device)`,kind:`custom`,wizard:{modelTarget:`utility`},run:async e=>(await loadSetup()).runAppleFmSetup(e,await n()),runNonInteractive:async e=>(await loadSetup()).configureAppleFmNonInteractive(e,await n()),validateNonInteractive:async e=>(await loadSetup()).validateAppleFmNonInteractive(e,await n()),appGuidedSetup:{detect:async e=>(await loadSetup()).detectAppleFmSetup(e,await n()),detectAvailability:async e=>Boolean(await(await loadSetup()).detectAppleFmSetup(e,await n())),prepare:async e=>(await loadSetup()).prepareAppleFmSetup(e,await n())}}],catalog:{order:`late`,run:async e=>{const t=e.config.models?.providers?.[APPLE_FM_PROVIDER_ID];return t&&process.platform===`darwin`?{provider:t}:null}},resolveSyntheticAuth:({providerConfig:e})=>process.platform===`darwin`&&e?{apiKey:APPLE_FM_LOCAL_AUTH_MARKER,source:`on-device Apple Foundation Models`,mode:`api-key`}:void 0,buildMissingAuthMessage:()=>`Run openclaw onboard and select Apple Foundation Models on a supported Mac to prepare local inference. No API key is required.`,createStreamFn:()=>nativeStream,wrapSimpleCompletionStreamFn:()=>nativeStream}}});export{apple_fm_default as default};