Skip to content

Add function support#12

Merged
fredvisser merged 6 commits intomainfrom
users/fvisser/add-function-support
Aug 22, 2025
Merged

Add function support#12
fredvisser merged 6 commits intomainfrom
users/fvisser/add-function-support

Conversation

@fredvisser
Copy link
Collaborator

Added (new files/features):

  • function CLI subsystem: function_click.py (full manage + execute + init commands for unified /nifunction/v2 service).
  • Secure template bootstrap helper: function_templates.py.
  • Config support: config.py plus .env.example for local dev overrides.
  • Comprehensive function command tests: test_function_click.py.

Modified:

  • README.md: Large new “Function Management” section, usage examples, dev env notes, added function-related feature bullets.
  • _version.py: Version bump.
  • main.py: Registers new function command group.
  • .gitignore: Added entry for .env

Scale of change:

  • ~2500 insertions, 4 deletions.
  • Major new functionality (WASM function definition & execution management, template init).
  • No broad refactors to existing non-function modules besides wiring/version/docs.

Key capabilities introduced:

  • List/query/get/create/update/delete function definitions (paginated, filters, workspace mapping).
  • Synchronous execute with HTTP-style parameters (method/path/headers/body) and guarded default (GET /) fallback only when user supplies none.
  • Interface summary (default path + endpoints) in get output.
  • Function executions list/get/cancel/retry support (unified model).
  • Template init command with secure GitHub tarball download (TypeScript & Python examples), --force overwrite semantics, path traversal & symlink guards.
  • Environment-based service URL overrides via .env.

Test coverage additions:

  • Pagination aggregation, get, execute parameter wrapping, interface summary, template init (success + non-empty dir abort).

@fredvisser fredvisser requested a review from Copilot August 22, 2025 18:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive function management capabilities to slcli, introducing WebAssembly (WASM) function definition and execution management through a unified v2 API. The implementation includes template initialization, secure GitHub template downloads, and configuration support.

Key changes:

  • New function CLI subsystem with complete CRUD operations for function definitions and execution management
  • Template bootstrap system with secure GitHub tarball downloads and path traversal protection
  • Environment-based configuration support via .env files
  • Comprehensive test coverage for all new functionality

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
tests/unit/test_function_click.py Comprehensive test suite for function CLI commands including pagination, execution, and template initialization
slcli/main.py Registers new function command group and updates docstring format
slcli/function_templates.py Secure template download helper with safety checks against path traversal and symlinks
slcli/function_click.py Complete function CLI implementation with manage/execute command groups and unified v2 API integration
slcli/config.py Configuration management for function service URLs
slcli/_version.py Version bump with comment update
README.md Extensive documentation for function management features and usage examples
.env.example Example environment configuration file

@fredvisser fredvisser merged commit 12c9b2e into main Aug 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants