| Agent | Trigger Threshold | Compression Strategy | Auxiliary Model | Token Tracking |
|---|---|---|---|---|
| Phosphor | 80% (configurable) | LLM summary; optional embedded dlgo model | Yes — main, small, or embedded (dlgo) |
(chars + 3) / 4 estimate |
| Oh-My-Pi | 80% (configurable) | 3 strategies: context-full, handoff, snapcompact (bitmap images) | Optional handoff task | Model-aware token budget |
| Hermes-Agent | 50% (configurable) | Pluggable ContextEngine (lossy LLM summary default) | Yes (configurable auxiliary model/provider) | API-reported + rough char estimate |
| OpenCode | Budget-based (window - buffer) | Checkpoint (summary + serialized context) | No | Local estimate vs. reserved headroom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as Sequelize from "sequelize"; | |
| import uuidv1 = require("uuid/v4"); | |
| import { SequelizeModelStatic } from "./sequelize"; | |
| import * as pLimit from "p-limit"; | |
| import _ = require("lodash"); | |
| /** | |
| * Get generated SQL query from sequelize. Returns a promise that: | |
| * 1. Adds a hook that receives the prepared options from Sequelize | |
| * - Since hooks work on the whole model, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Looks at User Agent to determine if IE and which version | |
| function GetIEVersion() { | |
| var sAgent = window.navigator.userAgent; | |
| var idx = sAgent.indexOf("MSIE"); | |
| var versionNumber = 0; | |
| // If IE, return version number. | |
| if (idx) { | |
| try { | |
| versionNumber = parseInt(sAgent.substring(idx+ 5, sAgent.indexOf(".", idx))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * React.js Material-UI Table and TableRow components with flexible height and fixed header | |
| * - fixes "jumping" scrolling bar in WebKit browsers | |
| * - shows permanent scrolling bar for other browsers | |
| * | |
| * Usage: import this Table and TableRow component instead of | |
| * 'material-ui/Table' and 'material-ui/TableRow' component | |
| */ | |
| import React, {PropTypes} from 'react'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If a directory has a cb-deploy.yaml file, it will run for CD | |
| steps: | |
| - name: 'gcr.io/cloud-builders/gcloud' | |
| entrypoint: 'bash' | |
| args: | |
| - '-c' | |
| - | | |
| for d in */; do | |
| config="${d}cb-deploy.yaml" | |
| if [[ ! -f "${config}" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The following pakcages are used by the function below | |
| // https://github.com/dgrijalva/jwt-go | |
| // https://github.com/lestrrat/go-jwx | |
| // ParseAndVerifyJWT will parse and verify a JWT, if an error is returned the token is invalid, | |
| // only a valid token will be returned. | |
| // | |
| // To verify the signature of an Amazon Cognito JWT, search for the key with a key ID that matches | |
| // the key ID of the JWT, then use libraries to decode the token and verify the signature. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Handle oauth2 callback, will exchange code for token | |
| func cognitoCallback(ctx context.Context, d *aegis.HandlerDependencies, req *aegis.APIGatewayProxyRequest, res *aegis.APIGatewayProxyResponse, params url.Values) error { | |
| // Exchange code for token | |
| tokens, err := d.Services.Cognito.GetTokens(req.QueryStringParameters["code"], []string{}) | |
| if err != nil { | |
| log.Println("Couldn't get access token", err) | |
| res.JSONError(500, err) | |
| } else { | |
| // verify the token | |
| _, err := d.Services.Cognito.ParseAndVerifyJWT(tokens.IDToken) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-lambda-trigger-syntax-shared.html | |
| // CognitoTriggerCallerContext contains information about the caller (should be the same for all triggers) | |
| type CognitoTriggerCallerContext struct { | |
| AWSSDKVersion string `json:"awsSdkVersion"` | |
| ClientID string `json:"clientId"` | |
| } | |
| // CognitoTriggerCommon contains common data from events sent by AWS Cognito (should be the same for all triggers) | |
| type CognitoTriggerCommon struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "github.com/oschwald/geoip2-golang" | |
| "github.com/fatih/structs" | |
| aegis "github.com/tmaiaroto/aegis/framework" | |
| "net" | |
| "context" | |
| "net/url" | |
| "log" |
NewerOlder