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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"name": "asta",
"source": "./plugins/asta",
"description": "Paper search, metadata, and document management for scientific research",
"version": "0.8.0",
"version": "0.8.1",
"author": {
"name": "AI2 Asta Team"
},
Expand All @@ -29,7 +29,7 @@
"name": "asta-preview",
"source": "./plugins/asta-preview",
"description": "Paper search, metadata, document management, literature reports, and experiments for scientific research",
"version": "0.8.0",
"version": "0.8.1",
"author": {
"name": "AI2 Asta Team"
},
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ make version
```bash
make set-version VERSION=x.y.z
```
- Updates `__init__.py`, `pyproject.toml`, and `marketplace.json`
- Updates all locations where version is referenced
- Run `make build-plugins` after to regenerate plugin packages
- Fails with error if VERSION parameter is not provided
- Provides suggested commit command after success
Expand Down
30 changes: 4 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,43 +104,21 @@ publish-test: build

# Set version in all files
set-version:
@if [ -z "$(VERSION)" ]; then \
echo "Error: VERSION parameter is required. Usage: make set-version VERSION=x.y.z"; \
exit 1; \
fi; \
echo "Setting version to $(VERSION) in all files..."; \
echo "Updating src/asta/__init__.py..."; \
sed -i.bak 's/__version__ = ".*"/__version__ = "$(VERSION)"/' src/asta/__init__.py && rm src/asta/__init__.py.bak; \
echo "Updating pyproject.toml..."; \
sed -i.bak 's/^version = ".*"/version = "$(VERSION)"/' pyproject.toml && rm pyproject.toml.bak; \
echo "Updating .claude-plugin/marketplace.json..."; \
uv run python -c "import json; f = open('.claude-plugin/marketplace.json', 'r'); data = json.load(f); f.close(); [p.__setitem__('version', '$(VERSION)') for p in data['plugins']]; f = open('.claude-plugin/marketplace.json', 'w'); json.dump(data, f, indent=2); f.write('\n'); f.close()"; \
echo "Version set to $(VERSION)"; \
echo "Now run: make build-plugins"
@uv run python scripts/manage-version.py set $(VERSION)

# Create and push git tag using version from code
push-version-tag:
@echo "Checking version consistency..."; \
INIT_VERSION=$$(uv run python -c "from src.asta import __version__; print(__version__)"); \
PYPROJECT_VERSION=$$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/'); \
MARKETPLACE_VERSION=$$(uv run python -c "import json; data = json.load(open('.claude-plugin/marketplace.json')); print(data['plugins'][0]['version'])"); \
if [ "$$INIT_VERSION" != "$$PYPROJECT_VERSION" ] || [ "$$INIT_VERSION" != "$$MARKETPLACE_VERSION" ]; then \
echo "Error: Version mismatch detected:"; \
echo " src/asta/__init__.py: $$INIT_VERSION"; \
echo " pyproject.toml: $$PYPROJECT_VERSION"; \
echo " .claude-plugin/marketplace.json: $$MARKETPLACE_VERSION"; \
echo ""; \
echo "Run 'make set-version VERSION=x.y.z' to sync versions"; \
@if ! uv run python scripts/manage-version.py check; then \
exit 1; \
fi; \
VERSION=$$INIT_VERSION; \
VERSION=$$(uv run python scripts/manage-version.py show); \
git tag v$$VERSION && \
git push origin v$$VERSION && \
echo "Pushed tag v$$VERSION"

# Show current version
version:
@uv run python -c "from src.asta import __version__; print(__version__)"
@uv run python scripts/manage-version.py show

# Quick check before commit
check: format-check lint test-unit
Expand Down
4 changes: 4 additions & 0 deletions hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{
"type": "command",
"command": "mkdir -p ~/.asta/literature"
},
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/sync-cli-version.sh"
}
]
}
Expand Down
31 changes: 31 additions & 0 deletions hooks/sync-cli-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Check if asta CLI version matches the plugin version and auto-install/update if needed

PLUGIN_VERSION=0.8.1
INSTALL_URL="git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION"

# Check if asta is installed
if ! command -v asta &> /dev/null; then
echo "📦 Installing Asta CLI version $PLUGIN_VERSION..."
if uv tool install "$INSTALL_URL"; then
echo "✅ Asta CLI $PLUGIN_VERSION installed successfully"
else
echo "❌ Failed to install Asta CLI"
exit 1
fi
exit 0
fi

# Get installed CLI version
CLI_VERSION=$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')

# Compare versions
if [ "$CLI_VERSION" != "$PLUGIN_VERSION" ]; then
echo "🔄 Updating Asta CLI from $CLI_VERSION to $PLUGIN_VERSION..."
if uv tool install --force "$INSTALL_URL"; then
echo "✅ Asta CLI updated to $PLUGIN_VERSION successfully"
else
echo "❌ Failed to update Asta CLI"
exit 1
fi
fi
4 changes: 4 additions & 0 deletions plugins/asta-preview/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{
"type": "command",
"command": "mkdir -p ~/.asta/literature"
},
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/sync-cli-version.sh"
}
]
}
Expand Down
31 changes: 31 additions & 0 deletions plugins/asta-preview/hooks/sync-cli-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Check if asta CLI version matches the plugin version and auto-install/update if needed

PLUGIN_VERSION=0.8.1
INSTALL_URL="git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION"

# Check if asta is installed
if ! command -v asta &> /dev/null; then
echo "📦 Installing Asta CLI version $PLUGIN_VERSION..."
if uv tool install "$INSTALL_URL"; then
echo "✅ Asta CLI $PLUGIN_VERSION installed successfully"
else
echo "❌ Failed to install Asta CLI"
exit 1
fi
exit 0
fi

# Get installed CLI version
CLI_VERSION=$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')

# Compare versions
if [ "$CLI_VERSION" != "$PLUGIN_VERSION" ]; then
echo "🔄 Updating Asta CLI from $CLI_VERSION to $PLUGIN_VERSION..."
if uv tool install --force "$INSTALL_URL"; then
echo "✅ Asta CLI updated to $PLUGIN_VERSION successfully"
else
echo "❌ Failed to update Asta CLI"
exit 1
fi
fi
12 changes: 9 additions & 3 deletions plugins/asta-preview/skills/experiment/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ allowed-tools:
- Read(.asta/experiment/*)
- TaskOutput
---

# Run Experiments

Run a computational experiment. Given a research question that can be answered via software,
Expand All @@ -19,11 +18,18 @@ This skill can also be used to analyze experimental data and generate a research

## Installation

If `asta` command is not available install it using `uv tool install git+https://github.com/allenai/asta-plugins.git`
This skill requires the `asta` CLI:

```bash
# Install/reinstall at the correct version
PLUGIN_VERSION=0.8.1
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
fi
```

**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)

Verify installation with `asta experiment --help`

## Workflow

Expand Down
13 changes: 10 additions & 3 deletions plugins/asta-preview/skills/find-literature/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,25 @@ allowed-tools:

# Find Literature

Search academic literature for papers relevant to a query. The search will return a ranked list of papers with relevance scores, summaries, and supporting snippets.
Search academic literature for papers relevant to a query. The search will return a ranked list of papers with relevance scores, summaries, and supporting snippets.

This is an advanced search, so the query can be long and complex. You may ask the user
questions to clarify the topic and refine the query before running the search.

## Installation

If `asta` command is not available install it using `uv tool install git+https://github.com/allenai/asta-plugins.git`
This skill requires the `asta` CLI:

```bash
# Install/reinstall at the correct version
PLUGIN_VERSION=0.8.1
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
fi
```

**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)

Verify installation with `asta literature --help`

## Tools Available

Expand Down
44 changes: 30 additions & 14 deletions plugins/asta-preview/skills/pdf-extraction/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: PDF Text Extraction
description: Extract text from PDFs using olmOCR. Use when user asks to "extract text from PDF", "OCR a document", "read a PDF", or needs to process scanned documents.
allowed-tools:
- Bash(asta pdf-extraction *)
- Bash(olmocr *)
- Read(.asta/documents/*)
- Read(*/markdown/*)
- Write(.asta/documents/*)
- Read(*/markdown/*)
- Bash(mv *)
- Bash(cp *)
---
Expand All @@ -15,11 +14,24 @@ allowed-tools:

Extract high-quality text from PDFs using the [olmOCR](https://github.com/allenai/olmOCR) tool. This skill uses the olmocr CLI for cloud-based OCR processing.

## Quick Start
## Installation

This skill requires the `asta` CLI:

```bash
# Install/reinstall at the correct version
PLUGIN_VERSION=0.8.1
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
fi
```

**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)

### Extract Text from PDF

The olmocr CLI will auto-install on first use. Basic usage:
## Quick Start

Basic usage:

```bash
# Extract text from a PDF using a temporary workspace
Expand All @@ -29,19 +41,23 @@ asta pdf-extraction "$TEMP_WORKSPACE" \
--markdown

# Output will be in $TEMP_WORKSPACE/markdown/document.md
```

### Understanding olmocr CLI

The `asta pdf-extraction` command is a passthrough to `olmocr` with this syntax:

```bash
olmocr <workspace> [OPTIONS]
# Batch extract text from multiple PDFs
TEMP_WORKSPACE=$(mktemp -d)
asta pdf-extraction "$TEMP_WORKSPACE" \
--pdfs list-of-pdf-file-paths.txt \
--markdown

# Batch extract text from PDFs stored in S3
TEMP_WORKSPACE=$(mktemp -d)
asta pdf-extraction "$TEMP_WORKSPACE" \
--pdfs s3://my-bucket/prefix/*.pdf \
--markdown
```

**Key arguments:**
- `<workspace>` - Output directory (required, positional argument)
- `--pdfs` - PDF file(s) to process
- `<workspace>` - Output directory (required: positional argument)
- `--pdfs` - PDF file(s) to process (required: single path, path with wildcard, S3 path with wildcard, or a text file with paths)
- `--markdown` - Generate markdown output (recommended)
- `--workers` - Parallel workers (default: 20)

Expand Down
14 changes: 10 additions & 4 deletions plugins/asta-preview/skills/semantic-scholar/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allowed-tools:

# Semantic Scholar Lookup

Fast, targeted lookups of paper metadata, citations, and authors using the Semantic Scholar API via `asta papers` commands.
Fast, targeted lookups of paper metadata, citations, and authors using the Semantic Scholar API via `asta papers` commands.

## When to Use This Skill

Expand All @@ -21,11 +21,17 @@ Fast, targeted lookups of paper metadata, citations, and authors using the Seman

## Installation

If `asta` command is not available install it using `uv tool install git+https://github.com/allenai/asta-plugins.git`
This skill requires the `asta` CLI:

**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)
```bash
# Install/reinstall at the correct version
PLUGIN_VERSION=0.8.1
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
fi
```

Verify installation with `asta papers --help`
**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)

## Available Commands

Expand Down
4 changes: 4 additions & 0 deletions plugins/asta/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{
"type": "command",
"command": "mkdir -p ~/.asta/literature"
},
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/sync-cli-version.sh"
}
]
}
Expand Down
31 changes: 31 additions & 0 deletions plugins/asta/hooks/sync-cli-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Check if asta CLI version matches the plugin version and auto-install/update if needed

PLUGIN_VERSION=0.8.1
INSTALL_URL="git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION"

# Check if asta is installed
if ! command -v asta &> /dev/null; then
echo "📦 Installing Asta CLI version $PLUGIN_VERSION..."
if uv tool install "$INSTALL_URL"; then
echo "✅ Asta CLI $PLUGIN_VERSION installed successfully"
else
echo "❌ Failed to install Asta CLI"
exit 1
fi
exit 0
fi

# Get installed CLI version
CLI_VERSION=$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')

# Compare versions
if [ "$CLI_VERSION" != "$PLUGIN_VERSION" ]; then
echo "🔄 Updating Asta CLI from $CLI_VERSION to $PLUGIN_VERSION..."
if uv tool install --force "$INSTALL_URL"; then
echo "✅ Asta CLI updated to $PLUGIN_VERSION successfully"
else
echo "❌ Failed to update Asta CLI"
exit 1
fi
fi
Loading
Loading